From bf285554d7fdf4b71300a1e21a1208d04f6a1740 Mon Sep 17 00:00:00 2001 From: Paul-Louis NECH Date: Thu, 17 Apr 2025 22:43:48 +0200 Subject: [PATCH] hydra: checkpoint --- ELEMENT/4.js | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ELEMENT/jakub-kriz-4r_tHA3gsUY-unsplash.jpg | Bin 0 -> 1203003 bytes ELEMENT/ricardo-gomez-angel--98jVaVuGv0-unsplash.jpg | Bin 0 -> 4473779 bytes ELEMENT/silas-baisch-K785Da4A_JA-unsplash.jpg | Bin 0 -> 1219645 bytes ELEMENT/taylor-van-riper-yQorCngxzwI-unsplash.jpg | Bin 0 -> 609381 bytes MIRROR/jm.js | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ MIRROR/marine.js | 3 +-- MIRROR/maze.js | 59 ----------------------------------------------------------- StarryNights/30wild.js | 32 ++++++++++++++++++++++++++++++++ StarryNights/img/VUh-6lw0k.html | 35 +++++++++++++++++++++++++++++++++++ StarryNights/img/VUh-6lw0k_files/codemirror.css | 346 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ StarryNights/img/VUh-6lw0k_files/css | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ StarryNights/img/VUh-6lw0k_files/fontawesome.css | 5 +++++ StarryNights/img/VUh-6lw0k_files/hydra-synth | 4337 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ StarryNights/img/VUh-6lw0k_files/index-1010dfdc.js | 352 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ StarryNights/img/VUh-6lw0k_files/modal.css | 270 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ StarryNights/img/VUh-6lw0k_files/p5.min.js | 3 +++ StarryNights/img/VUh-6lw0k_files/show-hint.css | 36 ++++++++++++++++++++++++++++++++++++ StarryNights/img/VUh-6lw0k_files/style.css | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ StarryNights/img/VUh-6lw0k_files/tomorrow-night-eighties.css | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ StarryNights/moire_purple.js | 35 +++++++++++++++++++++++++++++++++++ URBANUS/containers.js | 34 ++++++++++++++++++++++++++++++++++ URBANUS/teng-yuhong-qMehmIyaXvY-unsplash.jpg | Bin 0 -> 4027724 bytes friends/april_come_she_will.js | 45 +++++++++++++++++++++++++++++++++++++++++++++ friends/dorian.js | 32 ++++++++++++++++++++++++++++++++ friends/kevin.js | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ friends/kevin0.js | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ friends/maze.js | 27 +++++++++++++++++++++++++++ friends/pierre_feuilles.js | 9 +++++---- friends/raph_rick.js | 27 +++++++++++++++++++++++++++ img/jm.png | Bin 0 -> 1558956 bytes img/massimiliano-morosinotto-uJIhAvqFJxg-unsplash.jpg | Bin 0 -> 3428539 bytes img/mountain.jpg | Bin 0 -> 4848228 bytes img/obama.png | Bin 0 -> 396835 bytes img/portrait_rhadamanthe.jpg | Bin 0 -> 91777 bytes img/rick.png | Bin 0 -> 339417 bytes img/tulipes.jpeg | Bin 0 -> 815109 bytes img/visualsofdana-0j8DqmAYpkw-unsplash.jpg | Bin 0 -> 2518570 bytes inspi/ojack_moire.js | 16 ++++++++++++++++ inspi/ritchse_corrupted.js | 15 +++++++++++++++ portraits/rhadamanthe.js | 41 +++++++++++++++++++++++++++++++++++++++++ 41 files changed, 6228 insertions(+), 65 deletions(-) create mode 100644 ELEMENT/4.js create mode 100644 ELEMENT/jakub-kriz-4r_tHA3gsUY-unsplash.jpg create mode 100644 ELEMENT/ricardo-gomez-angel--98jVaVuGv0-unsplash.jpg create mode 100644 ELEMENT/silas-baisch-K785Da4A_JA-unsplash.jpg create mode 100644 ELEMENT/taylor-van-riper-yQorCngxzwI-unsplash.jpg create mode 100644 MIRROR/jm.js create mode 100644 StarryNights/30wild.js create mode 100644 StarryNights/img/VUh-6lw0k.html create mode 100644 StarryNights/img/VUh-6lw0k_files/codemirror.css create mode 100644 StarryNights/img/VUh-6lw0k_files/css create mode 100644 StarryNights/img/VUh-6lw0k_files/fontawesome.css create mode 100644 StarryNights/img/VUh-6lw0k_files/hydra-synth create mode 100644 StarryNights/img/VUh-6lw0k_files/index-1010dfdc.js create mode 100644 StarryNights/img/VUh-6lw0k_files/modal.css create mode 100644 StarryNights/img/VUh-6lw0k_files/p5.min.js create mode 100644 StarryNights/img/VUh-6lw0k_files/show-hint.css create mode 100644 StarryNights/img/VUh-6lw0k_files/style.css create mode 100644 StarryNights/img/VUh-6lw0k_files/tomorrow-night-eighties.css create mode 100644 StarryNights/moire_purple.js create mode 100644 URBANUS/containers.js create mode 100644 URBANUS/teng-yuhong-qMehmIyaXvY-unsplash.jpg create mode 100644 friends/april_come_she_will.js create mode 100644 friends/dorian.js create mode 100644 friends/kevin.js create mode 100644 friends/kevin0.js create mode 100644 friends/maze.js create mode 100644 friends/raph_rick.js create mode 100644 img/jm.png create mode 100644 img/massimiliano-morosinotto-uJIhAvqFJxg-unsplash.jpg create mode 100644 img/mountain.jpg create mode 100644 img/obama.png create mode 100644 img/portrait_rhadamanthe.jpg create mode 100644 img/rick.png create mode 100644 img/tulipes.jpeg create mode 100644 img/visualsofdana-0j8DqmAYpkw-unsplash.jpg create mode 100644 inspi/ojack_moire.js create mode 100644 inspi/ritchse_corrupted.js create mode 100644 portraits/rhadamanthe.js diff --git a/ELEMENT/4.js b/ELEMENT/4.js new file mode 100644 index 0000000..a95003a --- /dev/null +++ b/ELEMENT/4.js @@ -0,0 +1,72 @@ +// s0.initImage("/home/pln/Work/Hydra/ELEMENT/taylor-van-riper-yQorCngxzwI-unsplash.jpg") +s0.initImage("https://images.unsplash.com/photo-1492496913980-501348b61469?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D") +s1.initImage("https://images.unsplash.com/photo-1613036582025-ba1d4ccb3226?q=80&w=735&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D") +s0.initImage("/home/pln/Work/Hydra/ELEMENT/ricardo-gomez-angel--98jVaVuGv0-unsplash.jpg") + + + + + + + + + + + + + + + + + + + + + + + + + + + + +src(s0) +// .rotate(() => 0.3 + time / 2) +.modulate(src(o2).scale(2)) +.out(o3) +src(o3).scale(0.9) +.mult(src(s1) + .scale(() => 1 + 0.4 * Math.sin(time / 12)) + // .modulate(voronoi(10,0.04)) +) +.out(o2) +src(o2) +.mask(voronoi(5, .1)) + .scale(() => 1 + 0.1 * a.fft[0]) + // .thresh(() => 0.6 + 0.4 * a.fft[2]) + // .add(src(s0) + // .scale(() => 9 + .4 * a.fft[0])) + // .rotate(() => time % 360) + // ) + // .modulate(src(s0).scale(1,() +> 0 + a.fft[2]),0.56) + // .brightness(() => -0.2 + 0.3 * a.fft[3]) + .add(gradient(0.8).modulate(osc(25,0.1,0.5)).repeat(() => 4 + 2 * Math.sin(time / 20),2).modulate(voronoi(20, .04).rotate(() => time/30)), 0.25) + .modulate(voronoi(20, .04) + .rotate(() => time/100) + .kaleid(() => 5*Math.sin(time/200)) + // .modulateHue(() => voronoi(20, .04)) + // .hue(() => time/100) + .out(o1) +src(o1) +.rotate(() => time/53) +// .scale(() => 0.4 + 0.1 *Math.sine(time/200)) +// .kaleid(5) +.brightness(0.2) +.contrast(1.8) +.out(o0) + +a.show() +a.setSmooth(0.9) + +// render(o3) +render() diff --git a/ELEMENT/jakub-kriz-4r_tHA3gsUY-unsplash.jpg b/ELEMENT/jakub-kriz-4r_tHA3gsUY-unsplash.jpg new file mode 100644 index 0000000..0e615be Binary files /dev/null and b/ELEMENT/jakub-kriz-4r_tHA3gsUY-unsplash.jpg differ diff --git a/ELEMENT/ricardo-gomez-angel--98jVaVuGv0-unsplash.jpg b/ELEMENT/ricardo-gomez-angel--98jVaVuGv0-unsplash.jpg new file mode 100644 index 0000000..91d59d7 Binary files /dev/null and b/ELEMENT/ricardo-gomez-angel--98jVaVuGv0-unsplash.jpg differ diff --git a/ELEMENT/silas-baisch-K785Da4A_JA-unsplash.jpg b/ELEMENT/silas-baisch-K785Da4A_JA-unsplash.jpg new file mode 100644 index 0000000..6736644 Binary files /dev/null and b/ELEMENT/silas-baisch-K785Da4A_JA-unsplash.jpg differ diff --git a/ELEMENT/taylor-van-riper-yQorCngxzwI-unsplash.jpg b/ELEMENT/taylor-van-riper-yQorCngxzwI-unsplash.jpg new file mode 100644 index 0000000..66a7436 Binary files /dev/null and b/ELEMENT/taylor-van-riper-yQorCngxzwI-unsplash.jpg differ diff --git a/MIRROR/jm.js b/MIRROR/jm.js new file mode 100644 index 0000000..b6f5fa6 --- /dev/null +++ b/MIRROR/jm.js @@ -0,0 +1,60 @@ +s0.initImage("///home/pln/Work/Hydra/img/jm.png") + +a.show() +a.setSmooth(0.84) + +src(s0) +// .scale(() => 1 + 2 * a.fft[0]) +.out(o0) + +src(o0) +.mult(src(s0) + .rotate(() => -1 * a.fft[3]) + .scale(() => 1 + 0.2 * a.fft[3]) +) +.thresh(() => 0.91 - 0.8 * a.fft[3]) +.diff( + src(s0) + .scale(() => 1 + 0.3 * a.fft[0]) + .colorama(() => 0.6 + 0.3 * Math.sin(time/200)) +) +.out(o1) +src(o1) +.out(o2) +src(o2) +.mult(src(o2).thresh(0.8),() => 0.5 + 0.4 * Math.sin(time / 13)) +.out(o3) +render(o3) + + +a.hide() + + +// POUSSIERE +s0.initImage("///home/pln/Work/Hydra/img/jm.png") +s1.initImage("/home/pln/Work/Hydra/StarryNights/img/september-13-2019-arches-cluster.jpg") +// s1.initCam(1) +src(s0) + // .modulate(noise()) + .scale(0.7) + // .repeatX(2) + .scroll(0,0.13) + .out(o0) +src(o0) + .add(src(s1) + .scale(() => 0.6 + 0.2 * Math.sin(time/10)) + .luma(() => 0.9 + 0.5 * Math.sin(time / 13)) + .brightness(() => -0.2 + 0.2 * Math.sin(time / 20)) + ) + .mask(src(s0).luma(0.5).invert()) +.out(o1) +src(o1) + .scale(0.9) +.out(o2) +src(o2) +.modulate(src(s0).scrollY(0.2).scale(() => 0.2 + 0.1 * Math.cos(time / 100))) // FOR 408.jpg +.modulate(src(s0).sub(src(o2).scroll(0.6)).colorama(2), 0.8) +// .scale(() => 2.5 + 0.5 * (time / 10 % 30)) +.add(noise(100,0.2).luma(0.9).scale(0.5)) +.out(o3) +render(o3) diff --git a/MIRROR/marine.js b/MIRROR/marine.js index b983753..e3d57fd 100644 --- a/MIRROR/marine.js +++ b/MIRROR/marine.js @@ -25,5 +25,4 @@ src(o1) .add(noise(100,0.2).luma(0.9).scale(0.5)) .out(o3) - -render() +render(o3) diff --git a/MIRROR/maze.js b/MIRROR/maze.js index 6df5b50..e69de29 100644 --- a/MIRROR/maze.js +++ b/MIRROR/maze.js @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -s0.initImage("/home/pln/Work/Hydra/zephyr/maze.png") -s1.initImage("/home/pln/Work/Hydra/StarryNights/img/september-13-2019-arches-cluster.jpg") -// s1.initCam(1) -src(s0) - // .modulate(noise()) - .scale(0.7) - // .repeatX(2) - .scroll(0,0.13) - .out(o0) -src(o0) - .add(src(s1) - .scale(() => 0.6 + 0.2 * Math.sin(time/10)) - .luma(() => 0.9 + 0.5 * Math.sin(time / 13)) - .brightness(() => -0.2 + 0.2 * Math.sin(time / 20)) - ) - .mask(src(s0).luma(0.5).invert()) -.out(o1) -src(o1) - .scale(0.9) -.out(o2) -src(o2) -.modulate(src(s0).scrollY(0.2).scale(() => 0.2 + 0.1 * Math.cos(time / 100))) // FOR 408.jpg -.modulate(src(s0).sub(src(o2).scroll(0.6)).colorama(2), 0.8) -// .scale(() => 2.5 + 0.5 * (time / 10 % 30)) -.add(noise(100,0.2).luma(0.9).scale(0.5)) -.out(o3) -render(o3) diff --git a/StarryNights/30wild.js b/StarryNights/30wild.js new file mode 100644 index 0000000..882bb3d --- /dev/null +++ b/StarryNights/30wild.js @@ -0,0 +1,32 @@ + + +// On March 30 in 1997 +// Four Faces of Mars + +// "Four sides of Mars are captured in these Hubble images, taken over the course of a day. Mars has rotated about ninety degrees between each view. +s0.initImage("https://imagine.gsfc.nasa.gov/hst_bday/images/march-30-2019-four-faces-of-mars.jpg") + +src(s0) +.scale(() => 0.5 + 0.15 * Math.sin(time/20),1.35) +.hue([0,0.5,0.6,0.7].fast(1/8)) +.out(o0) + +src(o0) +.scale(() => 0.99 + 0.15 * Math.sin(time/40),0.59) +.out(o1) + + + +src(o1) +.diff(src(o2).scale(0.99).thresh(() => 0.9 + 0.2 * Math.sin(time / 13))) +// .scale(() => 0.99 + 0.2 * Math.sin(time/9),0.65) +.out(o2) + +src(o2) +// .scroll(() => 0 + 0.1 * Math.sin(time/4),0.65) +.rotate(() => Math.sin(time/100)) +.blend(src(o3).scale(() => 1 + 0.15 * Math.sin(time / 130))) +.contrast(() => 1.5 + 0.4 * Math.sin(time/20)) +.out(o3) + +render(o3) diff --git a/StarryNights/img/VUh-6lw0k.html b/StarryNights/img/VUh-6lw0k.html new file mode 100644 index 0000000..e50569e --- /dev/null +++ b/StarryNights/img/VUh-6lw0k.html @@ -0,0 +1,35 @@ + + + + + VUh-6lw0k + + + + + + + + + + + + + + + + + + + + + + + + + + +
>>
\ No newline at end of file diff --git a/StarryNights/img/VUh-6lw0k_files/codemirror.css b/StarryNights/img/VUh-6lw0k_files/codemirror.css new file mode 100644 index 0000000..c7a8ae7 --- /dev/null +++ b/StarryNights/img/VUh-6lw0k_files/codemirror.css @@ -0,0 +1,346 @@ +/* BASICS */ + +.CodeMirror { + /* Set height, width, borders, and global font properties here */ + font-family: monospace; + height: 300px; + color: black; + direction: ltr; +} + +/* PADDING */ + +.CodeMirror-lines { + padding: 4px 0; /* Vertical padding around content */ +} +.CodeMirror pre { + padding: 0 4px; /* Horizontal padding of content */ +} + +.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { + background-color: white; /* The little square between H and V scrollbars */ +} + +/* GUTTER */ + +.CodeMirror-gutters { + border-right: 1px solid #ddd; + background-color: #f7f7f7; + white-space: nowrap; +} +.CodeMirror-linenumbers {} +.CodeMirror-linenumber { + padding: 0 3px 0 5px; + min-width: 20px; + text-align: right; + color: #999; + white-space: nowrap; +} + +.CodeMirror-guttermarker { color: black; } +.CodeMirror-guttermarker-subtle { color: #999; } + +/* CURSOR */ + +.CodeMirror-cursor { + border-left: 1px solid black; + border-right: none; + width: 0; +} +/* Shown when moving in bi-directional text */ +.CodeMirror div.CodeMirror-secondarycursor { + border-left: 1px solid silver; +} +.cm-fat-cursor .CodeMirror-cursor { + width: auto; + border: 0 !important; + background: #7e7; +} +.cm-fat-cursor div.CodeMirror-cursors { + z-index: 1; +} +.cm-fat-cursor-mark { + background-color: rgba(20, 255, 20, 0.5); + -webkit-animation: blink 1.06s steps(1) infinite; + -moz-animation: blink 1.06s steps(1) infinite; + animation: blink 1.06s steps(1) infinite; +} +.cm-animate-fat-cursor { + width: auto; + border: 0; + -webkit-animation: blink 1.06s steps(1) infinite; + -moz-animation: blink 1.06s steps(1) infinite; + animation: blink 1.06s steps(1) infinite; + background-color: #7e7; +} +@-moz-keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} +@-webkit-keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} +@keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} + +/* Can style cursor different in overwrite (non-insert) mode */ +.CodeMirror-overwrite .CodeMirror-cursor {} + +.cm-tab { display: inline-block; text-decoration: inherit; } + +.CodeMirror-rulers { + position: absolute; + left: 0; right: 0; top: -50px; bottom: -20px; + overflow: hidden; +} +.CodeMirror-ruler { + border-left: 1px solid #ccc; + top: 0; bottom: 0; + position: absolute; +} + +/* DEFAULT THEME */ + +.cm-s-default .cm-header {color: blue;} +.cm-s-default .cm-quote {color: #090;} +.cm-negative {color: #d44;} +.cm-positive {color: #292;} +.cm-header, .cm-strong {font-weight: bold;} +.cm-em {font-style: italic;} +.cm-link {text-decoration: underline;} +.cm-strikethrough {text-decoration: line-through;} + +.cm-s-default .cm-keyword {color: #708;} +.cm-s-default .cm-atom {color: #219;} +.cm-s-default .cm-number {color: #164;} +.cm-s-default .cm-def {color: #00f;} +.cm-s-default .cm-variable, +.cm-s-default .cm-punctuation, +.cm-s-default .cm-property, +.cm-s-default .cm-operator {} +.cm-s-default .cm-variable-2 {color: #05a;} +.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;} +.cm-s-default .cm-comment {color: #a50;} +.cm-s-default .cm-string {color: #a11;} +.cm-s-default .cm-string-2 {color: #f50;} +.cm-s-default .cm-meta {color: #555;} +.cm-s-default .cm-qualifier {color: #555;} +.cm-s-default .cm-builtin {color: #30a;} +.cm-s-default .cm-bracket {color: #997;} +.cm-s-default .cm-tag {color: #170;} +.cm-s-default .cm-attribute {color: #00c;} +.cm-s-default .cm-hr {color: #999;} +.cm-s-default .cm-link {color: #00c;} + +.cm-s-default .cm-error {color: #f00;} +.cm-invalidchar {color: #f00;} + +.CodeMirror-composing { border-bottom: 2px solid; } + +/* Default styles for common addons */ + +div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;} +div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} +.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } +.CodeMirror-activeline-background {background: #e8f2ff;} + +/* STOP */ + +/* The rest of this file contains styles related to the mechanics of + the editor. You probably shouldn't touch them. */ + +.CodeMirror { + position: relative; + overflow: hidden; + background: white; +} + +.CodeMirror-scroll { + overflow: scroll !important; /* Things will break if this is overridden */ + /* 30px is the magic margin used to hide the element's real scrollbars */ + /* See overflow: hidden in .CodeMirror */ + margin-bottom: -30px; margin-right: -30px; + padding-bottom: 30px; + height: 100%; + outline: none; /* Prevent dragging from highlighting the element */ + position: relative; +} +.CodeMirror-sizer { + position: relative; + border-right: 30px solid transparent; +} + +/* The fake, visible scrollbars. Used to force redraw during scrolling + before actual scrolling happens, thus preventing shaking and + flickering artifacts. */ +.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { + position: absolute; + z-index: 6; + display: none; +} +.CodeMirror-vscrollbar { + right: 0; top: 0; + overflow-x: hidden; + overflow-y: scroll; +} +.CodeMirror-hscrollbar { + bottom: 0; left: 0; + overflow-y: hidden; + overflow-x: scroll; +} +.CodeMirror-scrollbar-filler { + right: 0; bottom: 0; +} +.CodeMirror-gutter-filler { + left: 0; bottom: 0; +} + +.CodeMirror-gutters { + position: absolute; left: 0; top: 0; + min-height: 100%; + z-index: 3; +} +.CodeMirror-gutter { + white-space: normal; + height: 100%; + display: inline-block; + vertical-align: top; + margin-bottom: -30px; +} +.CodeMirror-gutter-wrapper { + position: absolute; + z-index: 4; + background: none !important; + border: none !important; +} +.CodeMirror-gutter-background { + position: absolute; + top: 0; bottom: 0; + z-index: 4; +} +.CodeMirror-gutter-elt { + position: absolute; + cursor: default; + z-index: 4; +} +.CodeMirror-gutter-wrapper ::selection { background-color: transparent } +.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent } + +.CodeMirror-lines { + cursor: text; + min-height: 1px; /* prevents collapsing before first draw */ +} +.CodeMirror pre { + /* Reset some styles that the rest of the page might have set */ + -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; + border-width: 0; + background: transparent; + font-family: inherit; + font-size: inherit; + margin: 0; + white-space: pre; + word-wrap: normal; + line-height: inherit; + color: inherit; + z-index: 2; + position: relative; + overflow: visible; + -webkit-tap-highlight-color: transparent; + -webkit-font-variant-ligatures: contextual; + font-variant-ligatures: contextual; +} +.CodeMirror-wrap pre { + word-wrap: break-word; + white-space: pre-wrap; + word-break: normal; +} + +.CodeMirror-linebackground { + position: absolute; + left: 0; right: 0; top: 0; bottom: 0; + z-index: 0; +} + +.CodeMirror-linewidget { + position: relative; + z-index: 2; + padding: 0.1px; /* Force widget margins to stay inside of the container */ +} + +.CodeMirror-widget {} + +.CodeMirror-rtl pre { direction: rtl; } + +.CodeMirror-code { + outline: none; +} + +/* Force content-box sizing for the elements where we expect it */ +.CodeMirror-scroll, +.CodeMirror-sizer, +.CodeMirror-gutter, +.CodeMirror-gutters, +.CodeMirror-linenumber { + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +.CodeMirror-measure { + position: absolute; + width: 100%; + height: 0; + overflow: hidden; + visibility: hidden; +} + +.CodeMirror-cursor { + position: absolute; + pointer-events: none; +} +.CodeMirror-measure pre { position: static; } + +div.CodeMirror-cursors { + visibility: hidden; + position: relative; + z-index: 3; +} +div.CodeMirror-dragcursors { + visibility: visible; +} + +.CodeMirror-focused div.CodeMirror-cursors { + visibility: visible; +} + +.CodeMirror-selected { background: #d9d9d9; } +.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } +.CodeMirror-crosshair { cursor: crosshair; } +.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; } +.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; } + +.cm-searching { + background-color: #ffa; + background-color: rgba(255, 255, 0, .4); +} + +/* Used to force a border model for a node */ +.cm-force-border { padding-right: .1px; } + +@media print { + /* Hide the cursor when printing */ + .CodeMirror div.CodeMirror-cursors { + visibility: hidden; + } +} + +/* See issue #2901 */ +.cm-tab-wrap-hack:after { content: ''; } + +/* Help users use markselection to safely style text background */ +span.CodeMirror-selectedtext { background: none; } diff --git a/StarryNights/img/VUh-6lw0k_files/css b/StarryNights/img/VUh-6lw0k_files/css new file mode 100644 index 0000000..b65b0d1 --- /dev/null +++ b/StarryNights/img/VUh-6lw0k_files/css @@ -0,0 +1,72 @@ +/* vietnamese */ +@font-face { + font-family: 'Chivo'; + font-style: normal; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/chivo/v18/va9I4kzIxd1KFrBnQeNHkQ.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Chivo'; + font-style: normal; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/chivo/v18/va9I4kzIxd1KFrBmQeNHkQ.woff2) format('woff2'); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Chivo'; + font-style: normal; + font-weight: 300; + src: url(https://fonts.gstatic.com/s/chivo/v18/va9I4kzIxd1KFrBoQeM.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* vietnamese */ +@font-face { + font-family: 'Chivo'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/chivo/v18/va9I4kzIxd1KFrBnQeNHkQ.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Chivo'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/chivo/v18/va9I4kzIxd1KFrBmQeNHkQ.woff2) format('woff2'); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Chivo'; + font-style: normal; + font-weight: 400; + src: url(https://fonts.gstatic.com/s/chivo/v18/va9I4kzIxd1KFrBoQeM.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* vietnamese */ +@font-face { + font-family: 'Chivo'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/chivo/v18/va9I4kzIxd1KFrBnQeNHkQ.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Chivo'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/chivo/v18/va9I4kzIxd1KFrBmQeNHkQ.woff2) format('woff2'); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Chivo'; + font-style: normal; + font-weight: 700; + src: url(https://fonts.gstatic.com/s/chivo/v18/va9I4kzIxd1KFrBoQeM.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} diff --git a/StarryNights/img/VUh-6lw0k_files/fontawesome.css b/StarryNights/img/VUh-6lw0k_files/fontawesome.css new file mode 100644 index 0000000..0c5cde9 --- /dev/null +++ b/StarryNights/img/VUh-6lw0k_files/fontawesome.css @@ -0,0 +1,5 @@ +/*! + * Font Awesome Free 5.2.0 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + */ +.fa,.fab,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{animation:a 2s infinite linear}.fa-pulse{animation:a 1s infinite steps(8)}@keyframes a{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";transform:scaleX(-1)}.fa-flip-vertical{transform:scaleY(-1)}.fa-flip-horizontal.fa-flip-vertical,.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"}.fa-flip-horizontal.fa-flip-vertical{transform:scale(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asterisk:before{content:"\f069"}.fa-asymmetrik:before{content:"\f372"}.fa-at:before{content:"\f1fa"}.fa-atlas:before{content:"\f558"}.fa-atom:before{content:"\f5d2"}.fa-audible:before{content:"\f373"}.fa-audio-description:before{content:"\f29e"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-award:before{content:"\f559"}.fa-aws:before{content:"\f375"}.fa-backspace:before{content:"\f55a"}.fa-backward:before{content:"\f04a"}.fa-balance-scale:before{content:"\f24e"}.fa-ban:before{content:"\f05e"}.fa-band-aid:before{content:"\f462"}.fa-bandcamp:before{content:"\f2d5"}.fa-barcode:before{content:"\f02a"}.fa-bars:before{content:"\f0c9"}.fa-baseball-ball:before{content:"\f433"}.fa-basketball-ball:before{content:"\f434"}.fa-bath:before{content:"\f2cd"}.fa-battery-empty:before{content:"\f244"}.fa-battery-full:before{content:"\f240"}.fa-battery-half:before{content:"\f242"}.fa-battery-quarter:before{content:"\f243"}.fa-battery-three-quarters:before{content:"\f241"}.fa-bed:before{content:"\f236"}.fa-beer:before{content:"\f0fc"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-bell:before{content:"\f0f3"}.fa-bell-slash:before{content:"\f1f6"}.fa-bezier-curve:before{content:"\f55b"}.fa-bicycle:before{content:"\f206"}.fa-bimobject:before{content:"\f378"}.fa-binoculars:before{content:"\f1e5"}.fa-birthday-cake:before{content:"\f1fd"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blender:before{content:"\f517"}.fa-blind:before{content:"\f29d"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bold:before{content:"\f032"}.fa-bolt:before{content:"\f0e7"}.fa-bomb:before{content:"\f1e2"}.fa-bone:before{content:"\f5d7"}.fa-bong:before{content:"\f55c"}.fa-book:before{content:"\f02d"}.fa-book-open:before{content:"\f518"}.fa-book-reader:before{content:"\f5da"}.fa-bookmark:before{content:"\f02e"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-box-open:before{content:"\f49e"}.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-brain:before{content:"\f5dc"}.fa-briefcase:before{content:"\f0b1"}.fa-briefcase-medical:before{content:"\f469"}.fa-broadcast-tower:before{content:"\f519"}.fa-broom:before{content:"\f51a"}.fa-brush:before{content:"\f55d"}.fa-btc:before{content:"\f15a"}.fa-bug:before{content:"\f188"}.fa-building:before{content:"\f1ad"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-burn:before{content:"\f46a"}.fa-buromobelexperte:before{content:"\f37f"}.fa-bus:before{content:"\f207"}.fa-bus-alt:before{content:"\f55e"}.fa-buysellads:before{content:"\f20d"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-alt:before{content:"\f073"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-times:before{content:"\f273"}.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-cannabis:before{content:"\f55f"}.fa-capsules:before{content:"\f46b"}.fa-car:before{content:"\f1b9"}.fa-car-alt:before{content:"\f5de"}.fa-car-battery:before{content:"\f5df"}.fa-car-crash:before{content:"\f5e1"}.fa-car-side:before{content:"\f5e4"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-square-down:before{content:"\f150"}.fa-caret-square-left:before{content:"\f191"}.fa-caret-square-right:before{content:"\f152"}.fa-caret-square-up:before{content:"\f151"}.fa-caret-up:before{content:"\f0d8"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-plus:before{content:"\f217"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-certificate:before{content:"\f0a3"}.fa-chalkboard:before{content:"\f51b"}.fa-chalkboard-teacher:before{content:"\f51c"}.fa-charging-station:before{content:"\f5e7"}.fa-chart-area:before{content:"\f1fe"}.fa-chart-bar:before{content:"\f080"}.fa-chart-line:before{content:"\f201"}.fa-chart-pie:before{content:"\f200"}.fa-check:before{content:"\f00c"}.fa-check-circle:before{content:"\f058"}.fa-check-double:before{content:"\f560"}.fa-check-square:before{content:"\f14a"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-chrome:before{content:"\f268"}.fa-church:before{content:"\f51d"}.fa-circle:before{content:"\f111"}.fa-circle-notch:before{content:"\f1ce"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clock:before{content:"\f017"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-download-alt:before{content:"\f381"}.fa-cloud-upload-alt:before{content:"\f382"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-cocktail:before{content:"\f561"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-coffee:before{content:"\f0f4"}.fa-cog:before{content:"\f013"}.fa-cogs:before{content:"\f085"}.fa-coins:before{content:"\f51e"}.fa-columns:before{content:"\f0db"}.fa-comment:before{content:"\f075"}.fa-comment-alt:before{content:"\f27a"}.fa-comment-dots:before{content:"\f4ad"}.fa-comment-slash:before{content:"\f4b3"}.fa-comments:before{content:"\f086"}.fa-compact-disc:before{content:"\f51f"}.fa-compass:before{content:"\f14e"}.fa-compress:before{content:"\f066"}.fa-concierge-bell:before{content:"\f562"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-cookie:before{content:"\f563"}.fa-cookie-bite:before{content:"\f564"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-couch:before{content:"\f4b8"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-credit-card:before{content:"\f09d"}.fa-crop:before{content:"\f125"}.fa-crop-alt:before{content:"\f565"}.fa-crosshairs:before{content:"\f05b"}.fa-crow:before{content:"\f520"}.fa-crown:before{content:"\f521"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cut:before{content:"\f0c4"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-dashcube:before{content:"\f210"}.fa-database:before{content:"\f1c0"}.fa-deaf:before{content:"\f2a4"}.fa-delicious:before{content:"\f1a5"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-desktop:before{content:"\f108"}.fa-deviantart:before{content:"\f1bd"}.fa-diagnoses:before{content:"\f470"}.fa-dice:before{content:"\f522"}.fa-dice-five:before{content:"\f523"}.fa-dice-four:before{content:"\f524"}.fa-dice-one:before{content:"\f525"}.fa-dice-six:before{content:"\f526"}.fa-dice-three:before{content:"\f527"}.fa-dice-two:before{content:"\f528"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-digital-tachograph:before{content:"\f566"}.fa-directions:before{content:"\f5eb"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-divide:before{content:"\f529"}.fa-dizzy:before{content:"\f567"}.fa-dna:before{content:"\f471"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-dollar-sign:before{content:"\f155"}.fa-dolly:before{content:"\f472"}.fa-dolly-flatbed:before{content:"\f474"}.fa-donate:before{content:"\f4b9"}.fa-door-closed:before{content:"\f52a"}.fa-door-open:before{content:"\f52b"}.fa-dot-circle:before{content:"\f192"}.fa-dove:before{content:"\f4ba"}.fa-download:before{content:"\f019"}.fa-draft2digital:before{content:"\f396"}.fa-drafting-compass:before{content:"\f568"}.fa-draw-polygon:before{content:"\f5ee"}.fa-dribbble:before{content:"\f17d"}.fa-dribbble-square:before{content:"\f397"}.fa-dropbox:before{content:"\f16b"}.fa-drum:before{content:"\f569"}.fa-drum-steelpan:before{content:"\f56a"}.fa-drupal:before{content:"\f1a9"}.fa-dumbbell:before{content:"\f44b"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-ebay:before{content:"\f4f4"}.fa-edge:before{content:"\f282"}.fa-edit:before{content:"\f044"}.fa-eject:before{content:"\f052"}.fa-elementor:before{content:"\f430"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-ello:before{content:"\f5f1"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-square:before{content:"\f199"}.fa-envira:before{content:"\f299"}.fa-equals:before{content:"\f52c"}.fa-eraser:before{content:"\f12d"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-etsy:before{content:"\f2d7"}.fa-euro-sign:before{content:"\f153"}.fa-exchange-alt:before{content:"\f362"}.fa-exclamation:before{content:"\f12a"}.fa-exclamation-circle:before{content:"\f06a"}.fa-exclamation-triangle:before{content:"\f071"}.fa-expand:before{content:"\f065"}.fa-expand-arrows-alt:before{content:"\f31e"}.fa-expeditedssl:before{content:"\f23e"}.fa-external-link-alt:before{content:"\f35d"}.fa-external-link-square-alt:before{content:"\f360"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper:before{content:"\f1fb"}.fa-eye-slash:before{content:"\f070"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-facebook-square:before{content:"\f082"}.fa-fast-backward:before{content:"\f049"}.fa-fast-forward:before{content:"\f050"}.fa-fax:before{content:"\f1ac"}.fa-feather:before{content:"\f52d"}.fa-feather-alt:before{content:"\f56b"}.fa-female:before{content:"\f182"}.fa-fighter-jet:before{content:"\f0fb"}.fa-file:before{content:"\f15b"}.fa-file-alt:before{content:"\f15c"}.fa-file-archive:before{content:"\f1c6"}.fa-file-audio:before{content:"\f1c7"}.fa-file-code:before{content:"\f1c9"}.fa-file-contract:before{content:"\f56c"}.fa-file-download:before{content:"\f56d"}.fa-file-excel:before{content:"\f1c3"}.fa-file-export:before{content:"\f56e"}.fa-file-image:before{content:"\f1c5"}.fa-file-import:before{content:"\f56f"}.fa-file-invoice:before{content:"\f570"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-file-medical:before{content:"\f477"}.fa-file-medical-alt:before{content:"\f478"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-prescription:before{content:"\f572"}.fa-file-signature:before{content:"\f573"}.fa-file-upload:before{content:"\f574"}.fa-file-video:before{content:"\f1c8"}.fa-file-word:before{content:"\f1c2"}.fa-fill:before{content:"\f575"}.fa-fill-drip:before{content:"\f576"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-fingerprint:before{content:"\f577"}.fa-fire:before{content:"\f06d"}.fa-fire-extinguisher:before{content:"\f134"}.fa-firefox:before{content:"\f269"}.fa-first-aid:before{content:"\f479"}.fa-first-order:before{content:"\f2b0"}.fa-first-order-alt:before{content:"\f50a"}.fa-firstdraft:before{content:"\f3a1"}.fa-fish:before{content:"\f578"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flask:before{content:"\f0c3"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-flushed:before{content:"\f579"}.fa-fly:before{content:"\f417"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-font:before{content:"\f031"}.fa-font-awesome:before{content:"\f2b4"}.fa-font-awesome-alt:before{content:"\f35c"}.fa-font-awesome-flag:before{content:"\f425"}.fa-font-awesome-logo-full:before{content:"\f4e6"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-football-ball:before{content:"\f44e"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-forward:before{content:"\f04e"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-frog:before{content:"\f52e"}.fa-frown:before{content:"\f119"}.fa-frown-open:before{content:"\f57a"}.fa-fulcrum:before{content:"\f50b"}.fa-futbol:before{content:"\f1e3"}.fa-galactic-republic:before{content:"\f50c"}.fa-galactic-senate:before{content:"\f50d"}.fa-gamepad:before{content:"\f11b"}.fa-gas-pump:before{content:"\f52f"}.fa-gavel:before{content:"\f0e3"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-gift:before{content:"\f06b"}.fa-git:before{content:"\f1d3"}.fa-git-square:before{content:"\f1d2"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-github-square:before{content:"\f092"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glass-martini:before{content:"\f000"}.fa-glass-martini-alt:before{content:"\f57b"}.fa-glasses:before{content:"\f530"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-globe:before{content:"\f0ac"}.fa-globe-africa:before{content:"\f57c"}.fa-globe-americas:before{content:"\f57d"}.fa-globe-asia:before{content:"\f57e"}.fa-gofore:before{content:"\f3a7"}.fa-golf-ball:before{content:"\f450"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-wallet:before{content:"\f1ee"}.fa-graduation-cap:before{content:"\f19d"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-greater-than:before{content:"\f531"}.fa-greater-than-equal:before{content:"\f532"}.fa-grimace:before{content:"\f57f"}.fa-grin:before{content:"\f580"}.fa-grin-alt:before{content:"\f581"}.fa-grin-beam:before{content:"\f582"}.fa-grin-beam-sweat:before{content:"\f583"}.fa-grin-hearts:before{content:"\f584"}.fa-grin-squint:before{content:"\f585"}.fa-grin-squint-tears:before{content:"\f586"}.fa-grin-stars:before{content:"\f587"}.fa-grin-tears:before{content:"\f588"}.fa-grin-tongue:before{content:"\f589"}.fa-grin-tongue-squint:before{content:"\f58a"}.fa-grin-tongue-wink:before{content:"\f58b"}.fa-grin-wink:before{content:"\f58c"}.fa-grip-horizontal:before{content:"\f58d"}.fa-grip-vertical:before{content:"\f58e"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-gulp:before{content:"\f3ae"}.fa-h-square:before{content:"\f0fd"}.fa-hacker-news:before{content:"\f1d4"}.fa-hacker-news-square:before{content:"\f3af"}.fa-hackerrank:before{content:"\f5f7"}.fa-hand-holding:before{content:"\f4bd"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-hand-holding-usd:before{content:"\f4c0"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-paper:before{content:"\f256"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-rock:before{content:"\f255"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-spock:before{content:"\f259"}.fa-hands:before{content:"\f4c2"}.fa-hands-helping:before{content:"\f4c4"}.fa-handshake:before{content:"\f2b5"}.fa-hashtag:before{content:"\f292"}.fa-hdd:before{content:"\f0a0"}.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-headphones-alt:before{content:"\f58f"}.fa-headset:before{content:"\f590"}.fa-heart:before{content:"\f004"}.fa-heartbeat:before{content:"\f21e"}.fa-helicopter:before{content:"\f533"}.fa-highlighter:before{content:"\f591"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-history:before{content:"\f1da"}.fa-hockey-puck:before{content:"\f453"}.fa-home:before{content:"\f015"}.fa-hooli:before{content:"\f427"}.fa-hornbill:before{content:"\f592"}.fa-hospital:before{content:"\f0f8"}.fa-hospital-alt:before{content:"\f47d"}.fa-hospital-symbol:before{content:"\f47e"}.fa-hot-tub:before{content:"\f593"}.fa-hotel:before{content:"\f594"}.fa-hotjar:before{content:"\f3b1"}.fa-hourglass:before{content:"\f254"}.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-start:before{content:"\f251"}.fa-houzz:before{content:"\f27c"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-i-cursor:before{content:"\f246"}.fa-id-badge:before{content:"\f2c1"}.fa-id-card:before{content:"\f2c2"}.fa-id-card-alt:before{content:"\f47f"}.fa-image:before{content:"\f03e"}.fa-images:before{content:"\f302"}.fa-imdb:before{content:"\f2d8"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-industry:before{content:"\f275"}.fa-infinity:before{content:"\f534"}.fa-info:before{content:"\f129"}.fa-info-circle:before{content:"\f05a"}.fa-instagram:before{content:"\f16d"}.fa-internet-explorer:before{content:"\f26b"}.fa-ioxhost:before{content:"\f208"}.fa-italic:before{content:"\f033"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-java:before{content:"\f4e4"}.fa-jedi-order:before{content:"\f50e"}.fa-jenkins:before{content:"\f3b6"}.fa-joget:before{content:"\f3b7"}.fa-joint:before{content:"\f595"}.fa-joomla:before{content:"\f1aa"}.fa-js:before{content:"\f3b8"}.fa-js-square:before{content:"\f3b9"}.fa-jsfiddle:before{content:"\f1cc"}.fa-kaggle:before{content:"\f5fa"}.fa-key:before{content:"\f084"}.fa-keybase:before{content:"\f4f5"}.fa-keyboard:before{content:"\f11c"}.fa-keycdn:before{content:"\f3ba"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-kiss:before{content:"\f596"}.fa-kiss-beam:before{content:"\f597"}.fa-kiss-wink-heart:before{content:"\f598"}.fa-kiwi-bird:before{content:"\f535"}.fa-korvue:before{content:"\f42f"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laptop-code:before{content:"\f5fc"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-laugh:before{content:"\f599"}.fa-laugh-beam:before{content:"\f59a"}.fa-laugh-squint:before{content:"\f59b"}.fa-laugh-wink:before{content:"\f59c"}.fa-layer-group:before{content:"\f5fd"}.fa-leaf:before{content:"\f06c"}.fa-leanpub:before{content:"\f212"}.fa-lemon:before{content:"\f094"}.fa-less:before{content:"\f41d"}.fa-less-than:before{content:"\f536"}.fa-less-than-equal:before{content:"\f537"}.fa-level-down-alt:before{content:"\f3be"}.fa-level-up-alt:before{content:"\f3bf"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-line:before{content:"\f3c0"}.fa-link:before{content:"\f0c1"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lira-sign:before{content:"\f195"}.fa-list:before{content:"\f03a"}.fa-list-alt:before{content:"\f022"}.fa-list-ol:before{content:"\f0cb"}.fa-list-ul:before{content:"\f0ca"}.fa-location-arrow:before{content:"\f124"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-long-arrow-alt-down:before{content:"\f309"}.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-long-arrow-alt-right:before{content:"\f30b"}.fa-long-arrow-alt-up:before{content:"\f30c"}.fa-low-vision:before{content:"\f2a8"}.fa-luggage-cart:before{content:"\f59d"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-magic:before{content:"\f0d0"}.fa-magnet:before{content:"\f076"}.fa-mailchimp:before{content:"\f59e"}.fa-male:before{content:"\f183"}.fa-mandalorian:before{content:"\f50f"}.fa-map:before{content:"\f279"}.fa-map-marked:before{content:"\f59f"}.fa-map-marked-alt:before{content:"\f5a0"}.fa-map-marker:before{content:"\f041"}.fa-map-marker-alt:before{content:"\f3c5"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-markdown:before{content:"\f60f"}.fa-marker:before{content:"\f5a1"}.fa-mars:before{content:"\f222"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mastodon:before{content:"\f4f6"}.fa-maxcdn:before{content:"\f136"}.fa-medal:before{content:"\f5a2"}.fa-medapps:before{content:"\f3c6"}.fa-medium:before{content:"\f23a"}.fa-medium-m:before{content:"\f3c7"}.fa-medkit:before{content:"\f0fa"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-megaport:before{content:"\f5a3"}.fa-meh:before{content:"\f11a"}.fa-meh-blank:before{content:"\f5a4"}.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-memory:before{content:"\f538"}.fa-mercury:before{content:"\f223"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-alt:before{content:"\f3c9"}.fa-microphone-alt-slash:before{content:"\f539"}.fa-microphone-slash:before{content:"\f131"}.fa-microscope:before{content:"\f610"}.fa-microsoft:before{content:"\f3ca"}.fa-minus:before{content:"\f068"}.fa-minus-circle:before{content:"\f056"}.fa-minus-square:before{content:"\f146"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mizuni:before{content:"\f3cc"}.fa-mobile:before{content:"\f10b"}.fa-mobile-alt:before{content:"\f3cd"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-money-bill:before{content:"\f0d6"}.fa-money-bill-alt:before{content:"\f3d1"}.fa-money-bill-wave:before{content:"\f53a"}.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-money-check:before{content:"\f53c"}.fa-money-check-alt:before{content:"\f53d"}.fa-monument:before{content:"\f5a6"}.fa-moon:before{content:"\f186"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-motorcycle:before{content:"\f21c"}.fa-mouse-pointer:before{content:"\f245"}.fa-music:before{content:"\f001"}.fa-napster:before{content:"\f3d2"}.fa-neos:before{content:"\f612"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-nimblr:before{content:"\f5a8"}.fa-nintendo-switch:before{content:"\f418"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-not-equal:before{content:"\f53e"}.fa-notes-medical:before{content:"\f481"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-oil-can:before{content:"\f613"}.fa-old-republic:before{content:"\f510"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-osi:before{content:"\f41a"}.fa-outdent:before{content:"\f03b"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-paint-brush:before{content:"\f1fc"}.fa-paint-roller:before{content:"\f5aa"}.fa-palette:before{content:"\f53f"}.fa-palfed:before{content:"\f3d8"}.fa-pallet:before{content:"\f482"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-parachute-box:before{content:"\f4cd"}.fa-paragraph:before{content:"\f1dd"}.fa-parking:before{content:"\f540"}.fa-passport:before{content:"\f5ab"}.fa-paste:before{content:"\f0ea"}.fa-patreon:before{content:"\f3d9"}.fa-pause:before{content:"\f04c"}.fa-pause-circle:before{content:"\f28b"}.fa-paw:before{content:"\f1b0"}.fa-paypal:before{content:"\f1ed"}.fa-pen:before{content:"\f304"}.fa-pen-alt:before{content:"\f305"}.fa-pen-fancy:before{content:"\f5ac"}.fa-pen-nib:before{content:"\f5ad"}.fa-pen-square:before{content:"\f14b"}.fa-pencil-alt:before{content:"\f303"}.fa-pencil-ruler:before{content:"\f5ae"}.fa-people-carry:before{content:"\f4ce"}.fa-percent:before{content:"\f295"}.fa-percentage:before{content:"\f541"}.fa-periscope:before{content:"\f3da"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phoenix-squadron:before{content:"\f511"}.fa-phone:before{content:"\f095"}.fa-phone-slash:before{content:"\f3dd"}.fa-phone-square:before{content:"\f098"}.fa-phone-volume:before{content:"\f2a0"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-piggy-bank:before{content:"\f4d3"}.fa-pills:before{content:"\f484"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pinterest-square:before{content:"\f0d3"}.fa-plane:before{content:"\f072"}.fa-plane-arrival:before{content:"\f5af"}.fa-plane-departure:before{content:"\f5b0"}.fa-play:before{content:"\f04b"}.fa-play-circle:before{content:"\f144"}.fa-playstation:before{content:"\f3df"}.fa-plug:before{content:"\f1e6"}.fa-plus:before{content:"\f067"}.fa-plus-circle:before{content:"\f055"}.fa-plus-square:before{content:"\f0fe"}.fa-podcast:before{content:"\f2ce"}.fa-poo:before{content:"\f2fe"}.fa-poop:before{content:"\f619"}.fa-portrait:before{content:"\f3e0"}.fa-pound-sign:before{content:"\f154"}.fa-power-off:before{content:"\f011"}.fa-prescription:before{content:"\f5b1"}.fa-prescription-bottle:before{content:"\f485"}.fa-prescription-bottle-alt:before{content:"\f486"}.fa-print:before{content:"\f02f"}.fa-procedures:before{content:"\f487"}.fa-product-hunt:before{content:"\f288"}.fa-project-diagram:before{content:"\f542"}.fa-pushed:before{content:"\f3e1"}.fa-puzzle-piece:before{content:"\f12e"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\f128"}.fa-question-circle:before{content:"\f059"}.fa-quidditch:before{content:"\f458"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-r-project:before{content:"\f4f7"}.fa-random:before{content:"\f074"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-readme:before{content:"\f4d5"}.fa-rebel:before{content:"\f1d0"}.fa-receipt:before{content:"\f543"}.fa-recycle:before{content:"\f1b8"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-reddit-square:before{content:"\f1a2"}.fa-redo:before{content:"\f01e"}.fa-redo-alt:before{content:"\f2f9"}.fa-registered:before{content:"\f25d"}.fa-rendact:before{content:"\f3e4"}.fa-renren:before{content:"\f18b"}.fa-reply:before{content:"\f3e5"}.fa-reply-all:before{content:"\f122"}.fa-replyd:before{content:"\f3e6"}.fa-researchgate:before{content:"\f4f8"}.fa-resolving:before{content:"\f3e7"}.fa-retweet:before{content:"\f079"}.fa-rev:before{content:"\f5b2"}.fa-ribbon:before{content:"\f4d6"}.fa-road:before{content:"\f018"}.fa-robot:before{content:"\f544"}.fa-rocket:before{content:"\f135"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-route:before{content:"\f4d7"}.fa-rss:before{content:"\f09e"}.fa-rss-square:before{content:"\f143"}.fa-ruble-sign:before{content:"\f158"}.fa-ruler:before{content:"\f545"}.fa-ruler-combined:before{content:"\f546"}.fa-ruler-horizontal:before{content:"\f547"}.fa-ruler-vertical:before{content:"\f548"}.fa-rupee-sign:before{content:"\f156"}.fa-sad-cry:before{content:"\f5b3"}.fa-sad-tear:before{content:"\f5b4"}.fa-safari:before{content:"\f267"}.fa-sass:before{content:"\f41e"}.fa-save:before{content:"\f0c7"}.fa-schlix:before{content:"\f3ea"}.fa-school:before{content:"\f549"}.fa-screwdriver:before{content:"\f54a"}.fa-scribd:before{content:"\f28a"}.fa-search:before{content:"\f002"}.fa-search-minus:before{content:"\f010"}.fa-search-plus:before{content:"\f00e"}.fa-searchengin:before{content:"\f3eb"}.fa-seedling:before{content:"\f4d8"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-server:before{content:"\f233"}.fa-servicestack:before{content:"\f3ec"}.fa-shapes:before{content:"\f61f"}.fa-share:before{content:"\f064"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-share-square:before{content:"\f14d"}.fa-shekel-sign:before{content:"\f20b"}.fa-shield-alt:before{content:"\f3ed"}.fa-ship:before{content:"\f21a"}.fa-shipping-fast:before{content:"\f48b"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shoe-prints:before{content:"\f54b"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-shopping-cart:before{content:"\f07a"}.fa-shopware:before{content:"\f5b5"}.fa-shower:before{content:"\f2cc"}.fa-shuttle-van:before{content:"\f5b6"}.fa-sign:before{content:"\f4d9"}.fa-sign-in-alt:before{content:"\f2f6"}.fa-sign-language:before{content:"\f2a7"}.fa-sign-out-alt:before{content:"\f2f5"}.fa-signal:before{content:"\f012"}.fa-signature:before{content:"\f5b7"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sitemap:before{content:"\f0e8"}.fa-sith:before{content:"\f512"}.fa-skull:before{content:"\f54c"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack:before{content:"\f198"}.fa-slack-hash:before{content:"\f3ef"}.fa-sliders-h:before{content:"\f1de"}.fa-slideshare:before{content:"\f1e7"}.fa-smile:before{content:"\f118"}.fa-smile-beam:before{content:"\f5b8"}.fa-smile-wink:before{content:"\f4da"}.fa-smoking:before{content:"\f48d"}.fa-smoking-ban:before{content:"\f54d"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-snowflake:before{content:"\f2dc"}.fa-solar-panel:before{content:"\f5ba"}.fa-sort:before{content:"\f0dc"}.fa-sort-alpha-down:before{content:"\f15d"}.fa-sort-alpha-up:before{content:"\f15e"}.fa-sort-amount-down:before{content:"\f160"}.fa-sort-amount-up:before{content:"\f161"}.fa-sort-down:before{content:"\f0dd"}.fa-sort-numeric-down:before{content:"\f162"}.fa-sort-numeric-up:before{content:"\f163"}.fa-sort-up:before{content:"\f0de"}.fa-soundcloud:before{content:"\f1be"}.fa-spa:before{content:"\f5bb"}.fa-space-shuttle:before{content:"\f197"}.fa-speakap:before{content:"\f3f3"}.fa-spinner:before{content:"\f110"}.fa-splotch:before{content:"\f5bc"}.fa-spotify:before{content:"\f1bc"}.fa-spray-can:before{content:"\f5bd"}.fa-square:before{content:"\f0c8"}.fa-square-full:before{content:"\f45c"}.fa-squarespace:before{content:"\f5be"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-stamp:before{content:"\f5bf"}.fa-star:before{content:"\f005"}.fa-star-half:before{content:"\f089"}.fa-star-half-alt:before{content:"\f5c0"}.fa-star-of-life:before{content:"\f621"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-steam-symbol:before{content:"\f3f6"}.fa-step-backward:before{content:"\f048"}.fa-step-forward:before{content:"\f051"}.fa-stethoscope:before{content:"\f0f1"}.fa-sticker-mule:before{content:"\f3f7"}.fa-sticky-note:before{content:"\f249"}.fa-stop:before{content:"\f04d"}.fa-stop-circle:before{content:"\f28d"}.fa-stopwatch:before{content:"\f2f2"}.fa-store:before{content:"\f54e"}.fa-store-alt:before{content:"\f54f"}.fa-strava:before{content:"\f428"}.fa-stream:before{content:"\f550"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-stroopwafel:before{content:"\f551"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-subscript:before{content:"\f12c"}.fa-subway:before{content:"\f239"}.fa-suitcase:before{content:"\f0f2"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-sun:before{content:"\f185"}.fa-superpowers:before{content:"\f2dd"}.fa-superscript:before{content:"\f12b"}.fa-supple:before{content:"\f3f9"}.fa-surprise:before{content:"\f5c2"}.fa-swatchbook:before{content:"\f5c3"}.fa-swimmer:before{content:"\f5c4"}.fa-swimming-pool:before{content:"\f5c5"}.fa-sync:before{content:"\f021"}.fa-sync-alt:before{content:"\f2f1"}.fa-syringe:before{content:"\f48e"}.fa-table:before{content:"\f0ce"}.fa-table-tennis:before{content:"\f45d"}.fa-tablet:before{content:"\f10a"}.fa-tablet-alt:before{content:"\f3fa"}.fa-tablets:before{content:"\f490"}.fa-tachometer-alt:before{content:"\f3fd"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tape:before{content:"\f4db"}.fa-tasks:before{content:"\f0ae"}.fa-taxi:before{content:"\f1ba"}.fa-teamspeak:before{content:"\f4f9"}.fa-teeth:before{content:"\f62e"}.fa-teeth-open:before{content:"\f62f"}.fa-telegram:before{content:"\f2c6"}.fa-telegram-plane:before{content:"\f3fe"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-th:before{content:"\f00a"}.fa-th-large:before{content:"\f009"}.fa-th-list:before{content:"\f00b"}.fa-theater-masks:before{content:"\f630"}.fa-themeco:before{content:"\f5c6"}.fa-themeisle:before{content:"\f2b2"}.fa-thermometer:before{content:"\f491"}.fa-thermometer-empty:before{content:"\f2cb"}.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbtack:before{content:"\f08d"}.fa-ticket-alt:before{content:"\f3ff"}.fa-times:before{content:"\f00d"}.fa-times-circle:before{content:"\f057"}.fa-tint:before{content:"\f043"}.fa-tint-slash:before{content:"\f5c7"}.fa-tired:before{content:"\f5c8"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-toolbox:before{content:"\f552"}.fa-tooth:before{content:"\f5c9"}.fa-trade-federation:before{content:"\f513"}.fa-trademark:before{content:"\f25c"}.fa-traffic-light:before{content:"\f637"}.fa-train:before{content:"\f238"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-alt:before{content:"\f2ed"}.fa-tree:before{content:"\f1bb"}.fa-trello:before{content:"\f181"}.fa-tripadvisor:before{content:"\f262"}.fa-trophy:before{content:"\f091"}.fa-truck:before{content:"\f0d1"}.fa-truck-loading:before{content:"\f4de"}.fa-truck-monster:before{content:"\f63b"}.fa-truck-moving:before{content:"\f4df"}.fa-truck-pickup:before{content:"\f63c"}.fa-tshirt:before{content:"\f553"}.fa-tty:before{content:"\f1e4"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-tv:before{content:"\f26c"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-twitter-square:before{content:"\f081"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-uikit:before{content:"\f403"}.fa-umbrella:before{content:"\f0e9"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-underline:before{content:"\f0cd"}.fa-undo:before{content:"\f0e2"}.fa-undo-alt:before{content:"\f2ea"}.fa-uniregistry:before{content:"\f404"}.fa-universal-access:before{content:"\f29a"}.fa-university:before{content:"\f19c"}.fa-unlink:before{content:"\f127"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before{content:"\f13e"}.fa-untappd:before{content:"\f405"}.fa-upload:before{content:"\f093"}.fa-usb:before{content:"\f287"}.fa-user:before{content:"\f007"}.fa-user-alt:before{content:"\f406"}.fa-user-alt-slash:before{content:"\f4fa"}.fa-user-astronaut:before{content:"\f4fb"}.fa-user-check:before{content:"\f4fc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-clock:before{content:"\f4fd"}.fa-user-cog:before{content:"\f4fe"}.fa-user-edit:before{content:"\f4ff"}.fa-user-friends:before{content:"\f500"}.fa-user-graduate:before{content:"\f501"}.fa-user-lock:before{content:"\f502"}.fa-user-md:before{content:"\f0f0"}.fa-user-minus:before{content:"\f503"}.fa-user-ninja:before{content:"\f504"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-shield:before{content:"\f505"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-tie:before{content:"\f508"}.fa-user-times:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-users-cog:before{content:"\f509"}.fa-ussunnah:before{content:"\f407"}.fa-utensil-spoon:before{content:"\f2e5"}.fa-utensils:before{content:"\f2e7"}.fa-vaadin:before{content:"\f408"}.fa-vector-square:before{content:"\f5cb"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-vial:before{content:"\f492"}.fa-vials:before{content:"\f493"}.fa-viber:before{content:"\f409"}.fa-video:before{content:"\f03d"}.fa-video-slash:before{content:"\f4e2"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-square:before{content:"\f194"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-volleyball-ball:before{content:"\f45f"}.fa-volume-down:before{content:"\f027"}.fa-volume-off:before{content:"\f026"}.fa-volume-up:before{content:"\f028"}.fa-vuejs:before{content:"\f41f"}.fa-walking:before{content:"\f554"}.fa-wallet:before{content:"\f555"}.fa-warehouse:before{content:"\f494"}.fa-weebly:before{content:"\f5cc"}.fa-weibo:before{content:"\f18a"}.fa-weight:before{content:"\f496"}.fa-weight-hanging:before{content:"\f5cd"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whatsapp-square:before{content:"\f40c"}.fa-wheelchair:before{content:"\f193"}.fa-whmcs:before{content:"\f40d"}.fa-wifi:before{content:"\f1eb"}.fa-wikipedia-w:before{content:"\f266"}.fa-window-close:before{content:"\f410"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-windows:before{content:"\f17a"}.fa-wine-glass:before{content:"\f4e3"}.fa-wine-glass-alt:before{content:"\f5ce"}.fa-wix:before{content:"\f5cf"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-won-sign:before{content:"\f159"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-wrench:before{content:"\f0ad"}.fa-x-ray:before{content:"\f497"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yelp:before{content:"\f1e9"}.fa-yen-sign:before{content:"\f157"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-youtube-square:before{content:"\f431"}.fa-zhihu:before{content:"\f63f"}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}@font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:normal;src:url(../webfonts/fa-brands-400.eot);src:url(../webfonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.woff) format("woff"),url(../webfonts/fa-brands-400.ttf) format("truetype"),url(../webfonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:"Font Awesome 5 Brands"}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:400;src:url(../webfonts/fa-regular-400.eot);src:url(../webfonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.woff) format("woff"),url(../webfonts/fa-regular-400.ttf) format("truetype"),url(../webfonts/fa-regular-400.svg#fontawesome) format("svg")}.far{font-weight:400}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;src:url(../webfonts/fa-solid-900.eot);src:url(../webfonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.woff) format("woff"),url(../webfonts/fa-solid-900.ttf) format("truetype"),url(../webfonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.far,.fas{font-family:"Font Awesome 5 Free"}.fa,.fas{font-weight:900} diff --git a/StarryNights/img/VUh-6lw0k_files/hydra-synth b/StarryNights/img/VUh-6lw0k_files/hydra-synth new file mode 100644 index 0000000..93de4cb --- /dev/null +++ b/StarryNights/img/VUh-6lw0k_files/hydra-synth @@ -0,0 +1,4337 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Hydra = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 0) + er = args[0]; + if (er instanceof Error) { + // Note: The comments on the `throw` lines are intentional, they show + // up in Node's output if this results in an unhandled exception. + throw er; // Unhandled 'error' event + } + // At least give some kind of context to the user + var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); + err.context = er; + throw err; // Unhandled 'error' event + } + + var handler = events[type]; + + if (handler === undefined) + return false; + + if (typeof handler === 'function') { + ReflectApply(handler, this, args); + } else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + ReflectApply(listeners[i], this, args); + } + + return true; +}; + +function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; + + checkListener(listener); + + events = target._events; + if (events === undefined) { + events = target._events = Object.create(null); + target._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener !== undefined) { + target.emit('newListener', type, + listener.listener ? listener.listener : listener); + + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = target._events; + } + existing = events[type]; + } + + if (existing === undefined) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === 'function') { + // Adding the second element, need to change to array. + existing = events[type] = + prepend ? [listener, existing] : [existing, listener]; + // If we've already got an array, just append. + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + + // Check for listener leak + m = _getMaxListeners(target); + if (m > 0 && existing.length > m && !existing.warned) { + existing.warned = true; + // No error code for this since it is a Warning + // eslint-disable-next-line no-restricted-syntax + var w = new Error('Possible EventEmitter memory leak detected. ' + + existing.length + ' ' + String(type) + ' listeners ' + + 'added. Use emitter.setMaxListeners() to ' + + 'increase limit'); + w.name = 'MaxListenersExceededWarning'; + w.emitter = target; + w.type = type; + w.count = existing.length; + ProcessEmitWarning(w); + } + } + + return target; +} + +EventEmitter.prototype.addListener = function addListener(type, listener) { + return _addListener(this, type, listener, false); +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.prependListener = + function prependListener(type, listener) { + return _addListener(this, type, listener, true); + }; + +function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + if (arguments.length === 0) + return this.listener.call(this.target); + return this.listener.apply(this.target, arguments); + } +} + +function _onceWrap(target, type, listener) { + var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; + var wrapped = onceWrapper.bind(state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; +} + +EventEmitter.prototype.once = function once(type, listener) { + checkListener(listener); + this.on(type, _onceWrap(this, type, listener)); + return this; +}; + +EventEmitter.prototype.prependOnceListener = + function prependOnceListener(type, listener) { + checkListener(listener); + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; + +// Emits a 'removeListener' event if and only if the listener was removed. +EventEmitter.prototype.removeListener = + function removeListener(type, listener) { + var list, events, position, i, originalListener; + + checkListener(listener); + + events = this._events; + if (events === undefined) + return this; + + list = events[type]; + if (list === undefined) + return this; + + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else { + delete events[type]; + if (events.removeListener) + this.emit('removeListener', type, list.listener || listener); + } + } else if (typeof list !== 'function') { + position = -1; + + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } + } + + if (position < 0) + return this; + + if (position === 0) + list.shift(); + else { + spliceOne(list, position); + } + + if (list.length === 1) + events[type] = list[0]; + + if (events.removeListener !== undefined) + this.emit('removeListener', type, originalListener || listener); + } + + return this; + }; + +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + +EventEmitter.prototype.removeAllListeners = + function removeAllListeners(type) { + var listeners, events, i; + + events = this._events; + if (events === undefined) + return this; + + // not listening for removeListener, no need to emit + if (events.removeListener === undefined) { + if (arguments.length === 0) { + this._events = Object.create(null); + this._eventsCount = 0; + } else if (events[type] !== undefined) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else + delete events[type]; + } + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + var keys = Object.keys(events); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = Object.create(null); + this._eventsCount = 0; + return this; + } + + listeners = events[type]; + + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners !== undefined) { + // LIFO order + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } + + return this; + }; + +function _listeners(target, type, unwrap) { + var events = target._events; + + if (events === undefined) + return []; + + var evlistener = events[type]; + if (evlistener === undefined) + return []; + + if (typeof evlistener === 'function') + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + + return unwrap ? + unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); +} + +EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); +}; + +EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); +}; + +EventEmitter.listenerCount = function(emitter, type) { + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } +}; + +EventEmitter.prototype.listenerCount = listenerCount; +function listenerCount(type) { + var events = this._events; + + if (events !== undefined) { + var evlistener = events[type]; + + if (typeof evlistener === 'function') { + return 1; + } else if (evlistener !== undefined) { + return evlistener.length; + } + } + + return 0; +} + +EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; +}; + +function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) + copy[i] = arr[i]; + return copy; +} + +function spliceOne(list, index) { + for (; index + 1 < list.length; index++) + list[index] = list[index + 1]; + list.pop(); +} + +function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + return ret; +} + +function once(emitter, name) { + return new Promise(function (resolve, reject) { + function errorListener(err) { + emitter.removeListener(name, resolver); + reject(err); + } + + function resolver() { + if (typeof emitter.removeListener === 'function') { + emitter.removeListener('error', errorListener); + } + resolve([].slice.call(arguments)); + }; + + eventTargetAgnosticAddListener(emitter, name, resolver, { once: true }); + if (name !== 'error') { + addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }); + } + }); +} + +function addErrorHandlerIfEventEmitter(emitter, handler, flags) { + if (typeof emitter.on === 'function') { + eventTargetAgnosticAddListener(emitter, 'error', handler, flags); + } +} + +function eventTargetAgnosticAddListener(emitter, name, listener, flags) { + if (typeof emitter.on === 'function') { + if (flags.once) { + emitter.once(name, listener); + } else { + emitter.on(name, listener); + } + } else if (typeof emitter.addEventListener === 'function') { + // EventTarget does not have `error` event semantics like Node + // EventEmitters, we do not listen for `error` events here. + emitter.addEventListener(name, function wrapListener(arg) { + // IE does not have builtin `{ once: true }` support so we + // have to do it manually. + if (flags.once) { + emitter.removeEventListener(name, wrapListener); + } + listener(arg); + }); + } else { + throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); + } +} + +},{}],2:[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } +} + +},{}],3:[function(require,module,exports){ +!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(r="undefined"!=typeof globalThis?globalThis:r||self).Meyda=t()}(this,(function(){"use strict";function r(r,t,e){if(e||2===arguments.length)for(var a,n=0,o=t.length;n0;n--)t[r-n]=t[n-1];return t},sine:function(r){for(var t=Math.PI/(r-1),e=new Float32Array(r),a=0;a1;)r/=2;return 1===r}function n(r,a){if("rect"!==a){if(""!==a&&a||(a="hanning"),e[a]||(e[a]={}),!e[a][r.length])try{e[a][r.length]=t[a](r.length)}catch(r){throw new Error("Invalid windowing function")}r=function(r,t){for(var e=[],a=0;al;)c[s++]=m,l=s*e[f.length-1]/o;c[o]=f.length-1;for(m=0;mu&&f>=0;)o-=a[f],--f;return(f+1)*n},spectralFlatness:function(r){var t=r.ampSpectrum;if("object"!=typeof t)throw new TypeError;for(var e=0,a=0,n=0;n=0&&t[a]<0||t[a-1]<0&&t[a]>=0)&&e++;return e},loudness:s,perceptualSpread:function(r){for(var t=s({ampSpectrum:r.ampSpectrum,barkScale:r.barkScale}),e=0,a=0;ae&&(e=t.specific[a]);return Math.pow((t.total-e)/t.total,2)},perceptualSharpness:function(r){for(var t=s({ampSpectrum:r.ampSpectrum,barkScale:r.barkScale}),e=t.specific,a=0,n=0;na?r:a})),e/=t.length,e=Math.sqrt(e),a/e},melBands:p});function S(r){if(Array.isArray(r)){for(var t=0,e=Array(r.length);t 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + +},{}],6:[function(require,module,exports){ +var inherits = require('inherits') +var EventEmitter = require('events').EventEmitter +var now = require('right-now') +var raf = require('raf') + +module.exports = Engine +function Engine(fn) { + if (!(this instanceof Engine)) + return new Engine(fn) + this.running = false + this.last = now() + this._frame = 0 + this._tick = this.tick.bind(this) + + if (fn) + this.on('tick', fn) +} + +inherits(Engine, EventEmitter) + +Engine.prototype.start = function() { + if (this.running) + return + this.running = true + this.last = now() + this._frame = raf(this._tick) + return this +} + +Engine.prototype.stop = function() { + this.running = false + if (this._frame !== 0) + raf.cancel(this._frame) + this._frame = 0 + return this +} + +Engine.prototype.tick = function() { + this._frame = raf(this._tick) + var time = now() + var dt = time - this.last + this.emit('tick', dt) + this.last = time +} +},{"events":1,"inherits":2,"raf":7,"right-now":9}],7:[function(require,module,exports){ +(function (global){(function (){ +var now = require('performance-now') + , root = typeof window === 'undefined' ? global : window + , vendors = ['moz', 'webkit'] + , suffix = 'AnimationFrame' + , raf = root['request' + suffix] + , caf = root['cancel' + suffix] || root['cancelRequest' + suffix] + +for(var i = 0; !raf && i < vendors.length; i++) { + raf = root[vendors[i] + 'Request' + suffix] + caf = root[vendors[i] + 'Cancel' + suffix] + || root[vendors[i] + 'CancelRequest' + suffix] +} + +// Some versions of FF have rAF but not cAF +if(!raf || !caf) { + var last = 0 + , id = 0 + , queue = [] + , frameDuration = 1000 / 60 + + raf = function(callback) { + if(queue.length === 0) { + var _now = now() + , next = Math.max(0, frameDuration - (_now - last)) + last = next + _now + setTimeout(function() { + var cp = queue.slice(0) + // Clear queue here to prevent + // callbacks from appending listeners + // to the current frame's queue + queue.length = 0 + for(var i = 0; i < cp.length; i++) { + if(!cp[i].cancelled) { + try{ + cp[i].callback(last) + } catch(e) { + setTimeout(function() { throw e }, 0) + } + } + } + }, Math.round(next)) + } + queue.push({ + handle: ++id, + callback: callback, + cancelled: false + }) + return id + } + + caf = function(handle) { + for(var i = 0; i < queue.length; i++) { + if(queue[i].handle === handle) { + queue[i].cancelled = true + } + } + } +} + +module.exports = function(fn) { + // Wrap in a new function to prevent + // `cancel` potentially being assigned + // to the native rAF function + return raf.call(root, fn) +} +module.exports.cancel = function() { + caf.apply(root, arguments) +} +module.exports.polyfill = function(object) { + if (!object) { + object = root; + } + object.requestAnimationFrame = raf + object.cancelAnimationFrame = caf +} + +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"performance-now":4}],8:[function(require,module,exports){ +(function(aa,ia){"object"===typeof exports&&"undefined"!==typeof module?module.exports=ia():"function"===typeof define&&define.amd?define(ia):aa.createREGL=ia()})(this,function(){function aa(a,b){this.id=Ab++;this.type=a;this.data=b}function ia(a){if(0===a.length)return[];var b=a.charAt(0),c=a.charAt(a.length-1);if(1>>=b;c=(255>>=c;b|=c;c=(15>>=c;b|=c;c=(3>>c>>1}function cb(){function a(a){a:{for(var b=16;268435456>=b;b*=16)if(a<=b){a=b;break a}a=0}b=c[bb(a)>>2];return 0>2].push(a)}var c=J(8,function(){return[]});return{alloc:a,free:b,allocType:function(b,c){var d=null;switch(b){case 5120:d=new Int8Array(a(c),0,c);break;case 5121:d=new Uint8Array(a(c),0,c);break;case 5122:d=new Int16Array(a(2*c),0,c);break;case 5123:d=new Uint16Array(a(2*c),0,c);break;case 5124:d=new Int32Array(a(4*c),0,c);break;case 5125:d=new Uint32Array(a(4*c),0,c);break;case 5126:d=new Float32Array(a(4*c),0,c);break;default:return null}return d.length!== +c?d.subarray(0,c):d},freeType:function(a){b(a.buffer)}}}function ma(a){return!!a&&"object"===typeof a&&Array.isArray(a.shape)&&Array.isArray(a.stride)&&"number"===typeof a.offset&&a.shape.length===a.stride.length&&(Array.isArray(a.data)||M(a.data))}function db(a,b,c,e,g,d){for(var n=0;nd&&(d=e.buffer.byteLength,5123===f?d>>=1:5125===f&&(d>>=2));e.vertCount=d;d=h;0>h&&(d=4,h=e.buffer.dimension,1===h&&(d=0),2===h&&(d=1),3===h&&(d=4));e.primType=d}function n(a){e.elementsCount--;delete f[a.id];a.buffer.destroy();a.buffer=null}var f={},r=0,q={uint8:5121,uint16:5123};b.oes_element_index_uint&&(q.uint32=5125);g.prototype.bind=function(){this.buffer.bind()};var t=[];return{create:function(a,b){function k(a){if(a)if("number"===typeof a)h(a),l.primType=4,l.vertCount=a|0, +l.type=5121;else{var b=null,c=35044,e=-1,g=-1,f=0,m=0;if(Array.isArray(a)||M(a)||ma(a))b=a;else if("data"in a&&(b=a.data),"usage"in a&&(c=jb[a.usage]),"primitive"in a&&(e=Sa[a.primitive]),"count"in a&&(g=a.count|0),"type"in a&&(m=q[a.type]),"length"in a)f=a.length|0;else if(f=g,5123===m||5122===m)f*=2;else if(5125===m||5124===m)f*=4;d(l,b,c,e,g,f,m)}else h(),l.primType=4,l.vertCount=0,l.type=5121;return k}var h=c.create(null,34963,!0),l=new g(h._buffer);e.elementsCount++;k(a);k._reglType="elements"; +k._elements=l;k.subdata=function(a,b){h.subdata(a,b);return k};k.destroy=function(){n(l)};return k},createStream:function(a){var b=t.pop();b||(b=new g(c.create(null,34963,!0,!1)._buffer));d(b,a,35040,-1,-1,0,0);return b},destroyStream:function(a){t.push(a)},getElements:function(a){return"function"===typeof a&&a._elements instanceof g?a._elements:null},clear:function(){S(f).forEach(n)}}}function kb(a){for(var b=x.allocType(5123,a.length),c=0;c>>31<<15,d=(e<<1>>>24)-127,e=e>>13&1023;b[c]=-24>d?g:-14>d?g+(e+1024>>-14-d):15>=e,c.height>>=e,C(c,d[e]),a.mipmask|=1<b;++b)a.images[b]=null;return a}function ib(a){for(var b=a.images,c=0;cb){for(var c=0;c=--this.refCount&&A(this)}});n.profile&&(d.getTotalTextureSize=function(){var a=0;Object.keys(X).forEach(function(b){a+=X[b].stats.size});return a});return{create2D:function(b,c){function e(a,b){var c=f.texInfo;y.call(c);var d=D();"number"===typeof a?"number"===typeof b?v(d,a|0,b|0):v(d,a|0,a|0):a?(O(c,a),N(d,a)):v(d,1,1);c.genMipmaps&&(d.mipmask=(d.width<<1)-1);f.mipmask=d.mipmask;r(f,d);f.internalformat=d.internalformat; +e.width=d.width;e.height=d.height;T(f);B(d,3553);R(c,3553);Aa();ib(d);n.profile&&(f.stats.size=Ja(f.internalformat,f.type,d.width,d.height,c.genMipmaps,!1));e.format=J[f.internalformat];e.type=da[f.type];e.mag=oa[c.magFilter];e.min=za[c.minFilter];e.wrapS=ka[c.wrapS];e.wrapT=ka[c.wrapT];return e}var f=new F(3553);X[f.id]=f;d.textureCount++;e(b,c);e.subimage=function(a,b,c,d){b|=0;c|=0;d|=0;var p=h();r(p,f);p.width=0;p.height=0;C(p,a);p.width=p.width||(f.width>>d)-b;p.height=p.height||(f.height>>d)- +c;T(f);k(p,3553,b,c,d);Aa();l(p);return e};e.resize=function(b,c){var d=b|0,h=c|0||d;if(d===f.width&&h===f.height)return e;e.width=f.width=d;e.height=f.height=h;T(f);for(var p,w=f.channels,z=f.type,I=0;f.mipmask>>I;++I){var fa=d>>I,ga=h>>I;if(!fa||!ga)break;p=x.zero.allocType(z,fa*ga*w);a.texImage2D(3553,I,f.format,fa,ga,0,f.format,f.type,p);p&&x.zero.freeType(p)}Aa();n.profile&&(f.stats.size=Ja(f.internalformat,f.type,d,h,!1,!1));return e};e._reglType="texture2d";e._texture=f;n.profile&&(e.stats= +f.stats);e.destroy=function(){f.decRef()};return e},createCube:function(b,c,e,f,g,ua){function A(a,b,c,d,e,f){var H,Y=m.texInfo;y.call(Y);for(H=0;6>H;++H)p[H]=D();if("number"===typeof a||!a)for(a=a|0||1,H=0;6>H;++H)v(p[H],a,a);else if("object"===typeof a)if(b)N(p[0],a),N(p[1],b),N(p[2],c),N(p[3],d),N(p[4],e),N(p[5],f);else if(O(Y,a),q(m,a),"faces"in a)for(a=a.faces,H=0;6>H;++H)r(p[H],m),N(p[H],a[H]);else for(H=0;6>H;++H)N(p[H],a);r(m,p[0]);m.mipmask=Y.genMipmaps?(p[0].width<<1)-1:p[0].mipmask;m.internalformat= +p[0].internalformat;A.width=p[0].width;A.height=p[0].height;T(m);for(H=0;6>H;++H)B(p[H],34069+H);R(Y,34067);Aa();n.profile&&(m.stats.size=Ja(m.internalformat,m.type,A.width,A.height,Y.genMipmaps,!0));A.format=J[m.internalformat];A.type=da[m.type];A.mag=oa[Y.magFilter];A.min=za[Y.minFilter];A.wrapS=ka[Y.wrapS];A.wrapT=ka[Y.wrapT];for(H=0;6>H;++H)ib(p[H]);return A}var m=new F(34067);X[m.id]=m;d.cubeCount++;var p=Array(6);A(b,c,e,f,g,ua);A.subimage=function(a,b,c,p,d){c|=0;p|=0;d|=0;var e=h();r(e,m); +e.width=0;e.height=0;C(e,b);e.width=e.width||(m.width>>d)-c;e.height=e.height||(m.height>>d)-p;T(m);k(e,34069+a,c,p,d);Aa();l(e);return A};A.resize=function(b){b|=0;if(b!==m.width){A.width=m.width=b;A.height=m.height=b;T(m);for(var c=0;6>c;++c)for(var p=0;m.mipmask>>p;++p)a.texImage2D(34069+c,p,m.format,b>>p,b>>p,0,m.format,m.type,null);Aa();n.profile&&(m.stats.size=Ja(m.internalformat,m.type,A.width,A.height,!1,!0));return A}};A._reglType="textureCube";A._texture=m;n.profile&&(A.stats=m.stats);A.destroy= +function(){m.decRef()};return A},clear:function(){for(var b=0;bc;++c)if(0!==(b.mipmask&1<> +c,b.height>>c,0,b.internalformat,b.type,null);else for(var d=0;6>d;++d)a.texImage2D(34069+d,c,b.internalformat,b.width>>c,b.height>>c,0,b.internalformat,b.type,null);R(b.texInfo,b.target)})}}}function Ob(a,b,c,e,g,d){function n(a,b,c){this.target=a;this.texture=b;this.renderbuffer=c;var d=a=0;b?(a=b.width,d=b.height):c&&(a=c.width,d=c.height);this.width=a;this.height=d}function f(a){a&&(a.texture&&a.texture._texture.decRef(),a.renderbuffer&&a.renderbuffer._renderbuffer.decRef())}function r(a,b,c){a&& +(a.texture?a.texture._texture.refCount+=1:a.renderbuffer._renderbuffer.refCount+=1)}function q(b,c){c&&(c.texture?a.framebufferTexture2D(36160,b,c.target,c.texture._texture.texture,0):a.framebufferRenderbuffer(36160,b,36161,c.renderbuffer._renderbuffer.renderbuffer))}function t(a){var b=3553,c=null,d=null,e=a;"object"===typeof a&&(e=a.data,"target"in a&&(b=a.target|0));a=e._reglType;"texture2d"===a?c=e:"textureCube"===a?c=e:"renderbuffer"===a&&(d=e,b=36161);return new n(b,c,d)}function m(a,b,c,d, +f){if(c)return a=e.create2D({width:a,height:b,format:d,type:f}),a._texture.refCount=0,new n(3553,a,null);a=g.create({width:a,height:b,format:d});a._renderbuffer.refCount=0;return new n(36161,null,a)}function C(a){return a&&(a.texture||a.renderbuffer)}function k(a,b,c){a&&(a.texture?a.texture.resize(b,c):a.renderbuffer&&a.renderbuffer.resize(b,c),a.width=b,a.height=c)}function h(){this.id=O++;R[this.id]=this;this.framebuffer=a.createFramebuffer();this.height=this.width=0;this.colorAttachments=[];this.depthStencilAttachment= +this.stencilAttachment=this.depthAttachment=null}function l(a){a.colorAttachments.forEach(f);f(a.depthAttachment);f(a.stencilAttachment);f(a.depthStencilAttachment)}function u(b){a.deleteFramebuffer(b.framebuffer);b.framebuffer=null;d.framebufferCount--;delete R[b.id]}function v(b){var d;a.bindFramebuffer(36160,b.framebuffer);var e=b.colorAttachments;for(d=0;dd;++d){for(m=0;ma;++a)c[a].resize(d);b.width=b.height=d;return b},_reglType:"framebufferCube",destroy:function(){c.forEach(function(a){a.destroy()})}})},clear:function(){S(R).forEach(u)},restore:function(){B.cur=null;B.next=null;B.dirty=!0;S(R).forEach(function(b){b.framebuffer=a.createFramebuffer();v(b)})}})}function ub(){this.w=this.z=this.y= +this.x=this.state=0;this.buffer=null;this.size=0;this.normalized=!1;this.type=5126;this.divisor=this.stride=this.offset=0}function Pb(a,b,c,e){a=c.maxAttributes;b=Array(a);for(c=0;c +a&&(a=b.stats.uniformsCount)});return a},c.getMaxAttributesCount=function(){var a=0;C.forEach(function(b){b.stats.attributesCount>a&&(a=b.stats.attributesCount)});return a});return{clear:function(){var b=a.deleteShader.bind(a);S(q).forEach(b);q={};S(t).forEach(b);t={};C.forEach(function(b){a.deleteProgram(b.program)});C.length=0;m={};c.shaderCount=0},program:function(a,b,d){var e=m[b];e||(e=m[b]={});var g=e[a];g||(g=new f(b,a),c.shaderCount++,r(g,d),e[a]=g,C.push(g));return g},restore:function(){q= +{};t={};for(var a=0;a"+b+"?"+e+".constant["+b+"]:0;"}).join(""),"}}else{", +"if(",f,"(",e,".buffer)){",z,"=",g,".createStream(",34962,",",e,".buffer);","}else{",z,"=",g,".getBuffer(",e,".buffer);","}",k,'="type" in ',e,"?",p.glTypes,"[",e,".type]:",z,".dtype;",w.normalized,"=!!",e,".normalized;");d("size");d("offset");d("stride");d("divisor");c("}}");c.exit("if(",w.isStream,"){",g,".destroyStream(",z,");","}");return w})});return f}function M(a){var b=a["static"],c=a.dynamic,d={};Object.keys(b).forEach(function(a){var c=b[a];d[a]=D(function(a,b){return"number"===typeof c|| +"boolean"===typeof c?""+c:a.link(c)})});Object.keys(c).forEach(function(a){var b=c[a];d[a]=P(b,function(a,c){return a.invoke(c,b)})});return d}function A(a,b,c,d,e){var f=y(a,e),g=x(a,f,e),h=O(a,e),k=R(a,e),m=E(a,e),ba=g.viewport;ba&&(k.viewport=ba);ba=l("scissor.box");(g=g[ba])&&(k[ba]=g);g=0>1)",v],");")}function b(){c(u,".drawArraysInstancedANGLE(",[q,r,t,v],");")}n?da?a():(c("if(",n,"){"),a(),c("}else{"),b(),c("}")):b()}function g(){function a(){c(k+".drawElements("+[q,t,C,r+"<<(("+C+"-5121)>>1)"]+");")}function b(){c(k+".drawArrays("+[q,r,t]+");")}n?da?a():(c("if(",n,"){"),a(),c("}else{"),b(),c("}")): +b()}var h=a.shared,k=h.gl,m=h.draw,l=d.draw,n=function(){var e=l.elements,f=b;if(e){if(e.contextDep&&d.contextDynamic||e.propDep)f=c;e=e.append(a,f)}else e=f.def(m,".","elements");e&&f("if("+e+")"+k+".bindBuffer(34963,"+e+".buffer.buffer);");return e}(),q=e("primitive"),r=e("offset"),t=function(){var e=l.count,f=b;if(e){if(e.contextDep&&d.contextDynamic||e.propDep)f=c;e=e.append(a,f)}else e=f.def(m,".","count");return e}();if("number"===typeof t){if(0===t)return}else c("if(",t,"){"),c.exit("}");var v, +u;ea&&(v=e("instances"),u=a.instancing);var C=n+".type",da=l.elements&&va(l.elements);ea&&("number"!==typeof v||0<=v)?"string"===typeof v?(c("if(",v,">0){"),f(),c("}else if(",v,"<0){"),g(),c("}")):f():g()}function ca(a,b,c,d,e){b=N();e=b.proc("body",e);ea&&(b.instancing=e.def(b.shared.extensions,".angle_instanced_arrays"));a(b,e,c,d);return b.compile().body}function L(a,b,c,d){wa(a,b);U(a,b,c,d.attributes,function(){return!0});W(a,b,c,d.uniforms,function(){return!0});S(a,b,b,c)}function da(a,b){var c= +a.proc("draw",1);wa(a,c);ua(a,c,b.context);K(a,c,b.framebuffer);V(a,c,b);Q(a,c,b.state);G(a,c,b,!1,!0);var d=b.shader.progVar.append(a,c);c(a.shared.gl,".useProgram(",d,".program);");if(b.shader.program)L(a,c,b,b.shader.program);else{var e=a.global.def("{}"),f=c.def(d,".id"),g=c.def(e,"[",f,"]");c(a.cond(g).then(g,".call(this,a0);")["else"](g,"=",e,"[",f,"]=",a.link(function(c){return ca(L,a,b,c,1)}),"(",d,");",g,".call(this,a0);"))}0=--this.refCount&&n(this)};g.profile&&(e.getTotalRenderbufferSize=function(){var a=0;Object.keys(t).forEach(function(b){a+=t[b].stats.size});return a});return{create:function(b,c){function k(b,c){var d=0,e=0,m=32854;"object"===typeof b&&b?("shape"in b?(e=b.shape,d=e[0]|0,e=e[1]|0):("radius"in b&&(d=e=b.radius|0),"width"in b&&(d=b.width|0),"height"in b&&(e=b.height|0)),"format"in b&&(m=f[b.format])): +"number"===typeof b?(d=b|0,e="number"===typeof c?c|0:d):b||(d=e=1);if(d!==h.width||e!==h.height||m!==h.format)return k.width=h.width=d,k.height=h.height=e,h.format=m,a.bindRenderbuffer(36161,h.renderbuffer),a.renderbufferStorage(36161,m,d,e),g.profile&&(h.stats.size=Q[h.format]*h.width*h.height),k.format=r[h.format],k}var h=new d(a.createRenderbuffer());t[h.id]=h;e.renderbufferCount++;k(b,c);k.resize=function(b,c){var d=b|0,e=c|0||d;if(d===h.width&&e===h.height)return k;k.width=h.width=d;k.height= +h.height=e;a.bindRenderbuffer(36161,h.renderbuffer);a.renderbufferStorage(36161,h.format,d,e);g.profile&&(h.stats.size=Q[h.format]*h.width*h.height);return k};k._reglType="renderbuffer";k._renderbuffer=h;g.profile&&(k.stats=h.stats);k.destroy=function(){h.decRef()};return k},clear:function(){S(t).forEach(n)},restore:function(){S(t).forEach(function(b){b.renderbuffer=a.createRenderbuffer();a.bindRenderbuffer(36161,b.renderbuffer);a.renderbufferStorage(36161,b.format,b.width,b.height)});a.bindRenderbuffer(36161, +null)}}},Wa=[];Wa[6408]=4;Wa[6407]=3;var Na=[];Na[5121]=1;Na[5126]=4;Na[36193]=2;var Da=["x","y","z","w"],Ub="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),Ga={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771, +"one minus constant alpha":32772,"src alpha saturate":776},Xa={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Pa={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},wb={cw:2304,ccw:2305},xb=new Z(!1,!1,!1,function(){}),Xb=function(a,b){function c(){this.endQueryIndex=this.startQueryIndex=-1;this.sum=0;this.stats= +null}function e(a,b,d){var e=n.pop()||new c;e.startQueryIndex=a;e.endQueryIndex=b;e.sum=0;e.stats=d;f.push(e)}if(!b.ext_disjoint_timer_query)return null;var g=[],d=[],n=[],f=[],r=[],q=[];return{beginQuery:function(a){var c=g.pop()||b.ext_disjoint_timer_query.createQueryEXT();b.ext_disjoint_timer_query.beginQueryEXT(35007,c);d.push(c);e(d.length-1,d.length,a)},endQuery:function(){b.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:e,update:function(){var a,c;a=d.length;if(0!==a){q.length= +Math.max(q.length,a+1);r.length=Math.max(r.length,a+1);r[0]=0;var e=q[0]=0;for(c=a=0;c=G.length&&e()}var c=yb(G,a);G[c]=b}}}function q(){var a=S.viewport,b=S.scissor_box;a[0]=a[1]=b[0]=b[1]=0;O.viewportWidth=O.framebufferWidth=O.drawingBufferWidth=a[2]=b[2]=k.drawingBufferWidth;O.viewportHeight=O.framebufferHeight=O.drawingBufferHeight=a[3]=b[3]=k.drawingBufferHeight}function t(){O.tick+=1;O.time=y(); +q();V.procs.poll()}function m(){q();V.procs.refresh();B&&B.update()}function y(){return(zb()-D)/1E3}a=Eb(a);if(!a)return null;var k=a.gl,h=k.getContextAttributes();k.isContextLost();var l=Fb(k,a);if(!l)return null;var u=Bb(),v={bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},x=l.extensions,B=Xb(k,x),D=zb(),J=k.drawingBufferWidth,P=k.drawingBufferHeight,O={tick:0,time:0,viewportWidth:J,viewportHeight:P,framebufferWidth:J, +framebufferHeight:P,drawingBufferWidth:J,drawingBufferHeight:P,pixelRatio:a.pixelRatio},R=Vb(k,x),J=Pb(k,x,R,u),F=Gb(k,v,a,J),T=Hb(k,x,F,v),Q=Qb(k,u,v,a),A=Kb(k,x,R,function(){V.procs.poll()},O,v,a),M=Wb(k,x,R,v,a),K=Ob(k,x,R,A,M,v),V=Tb(k,u,x,R,F,T,A,K,{},J,Q,{elements:null,primitive:4,count:-1,offset:0,instances:-1},O,B,a),u=Rb(k,K,V.procs.poll,O,h,x,R),S=V.next,L=k.canvas,G=[],U=[],W=[],Z=[a.onDestroy],ca=null;L&&(L.addEventListener("webglcontextlost",g,!1),L.addEventListener("webglcontextrestored", +d,!1));var aa=K.setFBO=n({framebuffer:la.define.call(null,1,"framebuffer")});m();h=E(n,{clear:function(a){if("framebuffer"in a)if(a.framebuffer&&"framebufferCube"===a.framebuffer_reglType)for(var b=0;6>b;++b)aa(E({framebuffer:a.framebuffer.faces[b]},a),f);else aa(a,f);else f(null,a)},prop:la.define.bind(null,1),context:la.define.bind(null,2),"this":la.define.bind(null,3),draw:n({}),buffer:function(a){return F.create(a,34962,!1,!1)},elements:function(a){return T.create(a,!1)},texture:A.create2D,cube:A.createCube, +renderbuffer:M.create,framebuffer:K.create,framebufferCube:K.createCube,attributes:h,frame:r,on:function(a,b){var c;switch(a){case "frame":return r(b);case "lost":c=U;break;case "restore":c=W;break;case "destroy":c=Z}c.push(b);return{cancel:function(){for(var a=0;a this.add(property)); + this.userProps = userProps; + } + + add(name) { + if (this.makeGlobal) window[name] = this.parent[name]; // this.sandbox.addToContext(name, `parent.${name}`) + } // sets on window as well as synth object if global (not needed for objects, which can be set directly) + + + set(property, value) { + if (this.makeGlobal) { + window[property] = value; + } + + this.parent[property] = value; + } + + tick() { + if (this.makeGlobal) { + this.userProps.forEach(property => { + this.parent[property] = window[property]; + }); // this.parent.speed = window.speed + } else {} + } + + eval(code) { + this.sandbox.eval(code); + } + +} + +var _default = EvalSandbox; +exports.default = _default; + +},{"./lib/array-utils.js":20,"./lib/sandbox.js":25}],11:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = formatArguments; + +var _arrayUtils = _interopRequireDefault(require("./lib/array-utils.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// [WIP] how to treat different dimensions (?) +const DEFAULT_CONVERSIONS = { + float: { + 'vec4': { + name: 'sum', + args: [[1, 1, 1, 1]] + }, + 'vec2': { + name: 'sum', + args: [[1, 1]] + } + } +}; + +function fillArrayWithDefaults(arr, len) { + // fill the array with default values if it's too short + while (arr.length < len) { + if (arr.length === 3) { + // push a 1 as the default for .a in vec4 + arr.push(1.0); + } else { + arr.push(0.0); + } + } + + return arr.slice(0, len); +} + +const ensure_decimal_dot = val => { + val = val.toString(); + + if (val.indexOf('.') < 0) { + val += '.'; + } + + return val; +}; + +function formatArguments(transform, startIndex, synthContext) { + const defaultArgs = transform.transform.inputs; + const userArgs = transform.userArgs; + const { + generators + } = transform.synth; + const { + src + } = generators; // depends on synth having src() function + + return defaultArgs.map((input, index) => { + const typedArg = { + value: input.default, + type: input.type, + // + isUniform: false, + name: input.name, + vecLen: 0 // generateGlsl: null // function for creating glsl + + }; + if (typedArg.type === 'float') typedArg.value = ensure_decimal_dot(input.default); + + if (input.type.startsWith('vec')) { + try { + typedArg.vecLen = Number.parseInt(input.type.substr(3)); + } catch (e) { + console.log(`Error determining length of vector input type ${input.type} (${input.name})`); + } + } // if user has input something for this argument + + + if (userArgs.length > index) { + typedArg.value = userArgs[index]; // do something if a composite or transform + + if (typeof userArgs[index] === 'function') { + // if (typedArg.vecLen > 0) { // expected input is a vector, not a scalar + // typedArg.value = (context, props, batchId) => (fillArrayWithDefaults(userArgs[index](props), typedArg.vecLen)) + // } else { + typedArg.value = (context, props, batchId) => { + try { + const val = userArgs[index](props); + + if (typeof val === 'number') { + return val; + } else { + console.warn('function does not return a number', userArgs[index]); + } + + return input.default; + } catch (e) { + console.warn('ERROR', e); + return input.default; + } + }; // } + + + typedArg.isUniform = true; + } else if (userArgs[index].constructor === Array) { + // if (typedArg.vecLen > 0) { // expected input is a vector, not a scalar + // typedArg.isUniform = true + // typedArg.value = fillArrayWithDefaults(typedArg.value, typedArg.vecLen) + // } else { + // console.log("is Array") + // filter out values that are not a number + // const filteredArray = userArgs[index].filter((val) => typeof val === 'number') + // typedArg.value = (context, props, batchId) => arrayUtils.getValue(filteredArray)(props) + typedArg.value = (context, props, batchId) => _arrayUtils.default.getValue(userArgs[index])(props); + + typedArg.isUniform = true; // } + } + } + + if (startIndex < 0) {} else { + if (typedArg.value && typedArg.value.transforms) { + const final_transform = typedArg.value.transforms[typedArg.value.transforms.length - 1]; + + if (final_transform.transform.glsl_return_type !== input.type) { + const defaults = DEFAULT_CONVERSIONS[input.type]; + + if (typeof defaults !== 'undefined') { + const default_def = defaults[final_transform.transform.glsl_return_type]; + + if (typeof default_def !== 'undefined') { + const { + name, + args + } = default_def; + typedArg.value = typedArg.value[name](...args); + } + } + } + + typedArg.isUniform = false; + } else if (typedArg.type === 'float' && typeof typedArg.value === 'number') { + typedArg.value = ensure_decimal_dot(typedArg.value); + } else if (typedArg.type.startsWith('vec') && typeof typedArg.value === 'object' && Array.isArray(typedArg.value)) { + typedArg.isUniform = false; + typedArg.value = `${typedArg.type}(${typedArg.value.map(ensure_decimal_dot).join(', ')})`; + } else if (input.type === 'sampler2D') { + // typedArg.tex = typedArg.value + var x = typedArg.value; + + typedArg.value = () => x.getTexture(); + + typedArg.isUniform = true; + } else { + // if passing in a texture reference, when function asks for vec4, convert to vec4 + if (typedArg.value.getTexture && input.type === 'vec4') { + var x1 = typedArg.value; + typedArg.value = src(x1); + typedArg.isUniform = false; + } + } // add tp uniform array if is a function that will pass in a different value on each render frame, + // or a texture/ external source + + + if (typedArg.isUniform) { + typedArg.name += startIndex; // shaderParams.uniforms.push(typedArg) + } + } + + return typedArg; + }); +} + +},{"./lib/array-utils.js":20}],12:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _default; + +var _formatArguments = _interopRequireDefault(require("./format-arguments.js")); + +var _arrayUtils = _interopRequireDefault(require("./lib/array-utils.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Add extra functionality to Array.prototype for generating sequences in time +// converts a tree of javascript functions to a shader +function _default(transforms) { + var shaderParams = { + uniforms: [], + // list of uniforms used in shader + glslFunctions: [], + // list of functions used in shader + fragColor: '' + }; + var gen = generateGlsl(transforms, shaderParams)('st'); + shaderParams.fragColor = gen; // remove uniforms with duplicate names + + let uniforms = {}; + shaderParams.uniforms.forEach(uniform => uniforms[uniform.name] = uniform); + shaderParams.uniforms = Object.values(uniforms); + return shaderParams; +} // recursive function for generating shader string from object containing functions and user arguments. Order of functions in string depends on type of function +// to do: improve variable names + + +function generateGlsl(transforms, shaderParams) { + // transform function that outputs a shader string corresponding to gl_FragColor + var fragColor = () => ''; // var uniforms = [] + // var glslFunctions = [] + + + transforms.forEach(transform => { + var inputs = (0, _formatArguments.default)(transform, shaderParams.uniforms.length); + inputs.forEach(input => { + if (input.isUniform) shaderParams.uniforms.push(input); + }); // add new glsl function to running list of functions + + if (!contains(transform, shaderParams.glslFunctions)) shaderParams.glslFunctions.push(transform); // current function for generating frag color shader code + + var f0 = fragColor; + + if (transform.transform.type === 'src') { + fragColor = uv => `${shaderString(uv, transform.name, inputs, shaderParams)}`; + } else if (transform.transform.type === 'coord') { + fragColor = uv => `${f0(`${shaderString(uv, transform.name, inputs, shaderParams)}`)}`; + } else if (transform.transform.type === 'color') { + fragColor = uv => `${shaderString(`${f0(uv)}`, transform.name, inputs, shaderParams)}`; + } else if (transform.transform.type === 'combine') { + // combining two generated shader strings (i.e. for blend, mult, add funtions) + var f1 = inputs[0].value && inputs[0].value.transforms ? uv => `${generateGlsl(inputs[0].value.transforms, shaderParams)(uv)}` : inputs[0].isUniform ? () => inputs[0].name : () => inputs[0].value; + + fragColor = uv => `${shaderString(`${f0(uv)}, ${f1(uv)}`, transform.name, inputs.slice(1), shaderParams)}`; + } else if (transform.transform.type === 'combineCoord') { + // combining two generated shader strings (i.e. for modulate functions) + var f1 = inputs[0].value && inputs[0].value.transforms ? uv => `${generateGlsl(inputs[0].value.transforms, shaderParams)(uv)}` : inputs[0].isUniform ? () => inputs[0].name : () => inputs[0].value; + + fragColor = uv => `${f0(`${shaderString(`${uv}, ${f1(uv)}`, transform.name, inputs.slice(1), shaderParams)}`)}`; + } + }); // console.log(fragColor) + // break; + + return fragColor; +} // assembles a shader string containing the arguments and the function name, i.e. 'osc(uv, frequency)' + + +function shaderString(uv, method, inputs, shaderParams) { + const str = inputs.map(input => { + if (input.isUniform) { + return input.name; + } else if (input.value && input.value.transforms) { + // this by definition needs to be a generator, hence we start with 'st' as the initial value for generating the glsl fragment + return `${generateGlsl(input.value.transforms, shaderParams)('st')}`; + } + + return input.value; + }).reduce((p, c) => `${p}, ${c}`, ''); + return `${method}(${uv}${str})`; +} // merge two arrays and remove duplicates + + +function mergeArrays(a, b) { + return a.concat(b.filter(function (item) { + return a.indexOf(item) < 0; + })); +} // check whether array + + +function contains(object, arr) { + for (var i = 0; i < arr.length; i++) { + if (object.name == arr[i].name) return true; + } + + return false; +} + +},{"./format-arguments.js":11,"./lib/array-utils.js":20}],13:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _glslSource = _interopRequireDefault(require("./glsl-source.js")); + +var _glslFunctions = _interopRequireDefault(require("./glsl/glsl-functions.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +class GeneratorFactory { + constructor({ + defaultUniforms, + defaultOutput, + extendTransforms = [], + changeListener = () => {} + } = {}) { + this.defaultOutput = defaultOutput; + this.defaultUniforms = defaultUniforms; + this.changeListener = changeListener; + this.extendTransforms = extendTransforms; + this.generators = {}; + this.init(); + } + + init() { + const functions = (0, _glslFunctions.default)(); + this.glslTransforms = {}; + this.generators = Object.entries(this.generators).reduce((prev, [method, transform]) => { + this.changeListener({ + type: 'remove', + synth: this, + method + }); + return prev; + }, {}); + + this.sourceClass = (() => { + return class extends _glslSource.default {}; + })(); // add user definied transforms + + + if (Array.isArray(this.extendTransforms)) { + functions.concat(this.extendTransforms); + } else if (typeof this.extendTransforms === 'object' && this.extendTransforms.type) { + functions.push(this.extendTransforms); + } + + return functions.map(transform => this.setFunction(transform)); + } + + _addMethod(method, transform) { + const self = this; + this.glslTransforms[method] = transform; + + if (transform.type === 'src') { + const func = (...args) => new this.sourceClass({ + name: method, + transform: transform, + userArgs: args, + defaultOutput: this.defaultOutput, + defaultUniforms: this.defaultUniforms, + synth: self + }); + + this.generators[method] = func; + this.changeListener({ + type: 'add', + synth: this, + method + }); + return func; + } else { + this.sourceClass.prototype[method] = function (...args) { + this.transforms.push({ + name: method, + transform: transform, + userArgs: args, + synth: self + }); + return this; + }; + } + + return undefined; + } + + setFunction(obj) { + var processedGlsl = processGlsl(obj); + if (processedGlsl) this._addMethod(obj.name, processedGlsl); + } + +} + +const typeLookup = { + 'src': { + returnType: 'vec4', + args: ['vec2 _st'] + }, + 'coord': { + returnType: 'vec2', + args: ['vec2 _st'] + }, + 'color': { + returnType: 'vec4', + args: ['vec4 _c0'] + }, + 'combine': { + returnType: 'vec4', + args: ['vec4 _c0', 'vec4 _c1'] + }, + 'combineCoord': { + returnType: 'vec2', + args: ['vec2 _st', 'vec4 _c0'] + } +}; // expects glsl of format +// { +// name: 'osc', // name that will be used to access function as well as within glsl +// type: 'src', // can be src: vec4(vec2 _st), coord: vec2(vec2 _st), color: vec4(vec4 _c0), combine: vec4(vec4 _c0, vec4 _c1), combineCoord: vec2(vec2 _st, vec4 _c0) +// inputs: [ +// { +// name: 'freq', +// type: 'float', // 'float' //, 'texture', 'vec4' +// default: 0.2 +// }, +// { +// name: 'sync', +// type: 'float', +// default: 0.1 +// }, +// { +// name: 'offset', +// type: 'float', +// default: 0.0 +// } +// ], +// glsl: ` +// vec2 st = _st; +// float r = sin((st.x-offset*2/freq+time*sync)*freq)*0.5 + 0.5; +// float g = sin((st.x+time*sync)*freq)*0.5 + 0.5; +// float b = sin((st.x+offset/freq+time*sync)*freq)*0.5 + 0.5; +// return vec4(r, g, b, 1.0); +// ` +// } +// // generates glsl function: +// `vec4 osc(vec2 _st, float freq, float sync, float offset){ +// vec2 st = _st; +// float r = sin((st.x-offset*2/freq+time*sync)*freq)*0.5 + 0.5; +// float g = sin((st.x+time*sync)*freq)*0.5 + 0.5; +// float b = sin((st.x+offset/freq+time*sync)*freq)*0.5 + 0.5; +// return vec4(r, g, b, 1.0); +// }` + +function processGlsl(obj) { + let t = typeLookup[obj.type]; + + if (t) { + let baseArgs = t.args.map(arg => arg).join(", "); // @todo: make sure this works for all input types, add validation + + let customArgs = obj.inputs.map(input => `${input.type} ${input.name}`).join(', '); + let args = `${baseArgs}${customArgs.length > 0 ? ', ' + customArgs : ''}`; // console.log('args are ', args) + + let glslFunction = ` + ${t.returnType} ${obj.name}(${args}) { + ${obj.glsl} + } +`; // add extra input to beginning for backward combatibility @todo update compiler so this is no longer necessary + + if (obj.type === 'combine' || obj.type === 'combineCoord') obj.inputs.unshift({ + name: 'color', + type: 'vec4' + }); + return Object.assign({}, obj, { + glsl: glslFunction + }); + } else { + console.warn(`type ${obj.type} not recognized`, obj); + } +} + +var _default = GeneratorFactory; +exports.default = _default; + +},{"./glsl-source.js":14,"./glsl/glsl-functions.js":15}],14:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _generateGlsl = _interopRequireDefault(require("./generate-glsl.js")); + +var _utilityFunctions = _interopRequireDefault(require("./glsl/utility-functions.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// const formatArguments = require('./glsl-utils.js').formatArguments +// const glslTransforms = require('./glsl/composable-glsl-functions.js') +var GlslSource = function (obj) { + this.transforms = []; + this.transforms.push(obj); + this.defaultOutput = obj.defaultOutput; + this.synth = obj.synth; + this.type = 'GlslSource'; + this.defaultUniforms = obj.defaultUniforms; + return this; +}; + +GlslSource.prototype.addTransform = function (obj) { + this.transforms.push(obj); +}; + +GlslSource.prototype.out = function (_output) { + var output = _output || this.defaultOutput; + var glsl = this.glsl(output); + this.synth.currentFunctions = []; // output.renderPasses(glsl) + + if (output) try { + output.render(glsl); + } catch (error) { + console.log('shader could not compile', error); + } +}; + +GlslSource.prototype.glsl = function () { + //var output = _output || this.defaultOutput + var self = this; // uniforms included in all shaders + // this.defaultUniforms = output.uniforms + + var passes = []; + var transforms = []; // console.log('output', output) + + this.transforms.forEach(transform => { + if (transform.transform.type === 'renderpass') { + // if (transforms.length > 0) passes.push(this.compile(transforms, output)) + // transforms = [] + // var uniforms = {} + // const inputs = formatArguments(transform, -1) + // inputs.forEach((uniform) => { uniforms[uniform.name] = uniform.value }) + // + // passes.push({ + // frag: transform.transform.frag, + // uniforms: Object.assign({}, self.defaultUniforms, uniforms) + // }) + // transforms.push({name: 'prev', transform: glslTransforms['prev'], synth: this.synth}) + console.warn('no support for renderpass'); + } else { + transforms.push(transform); + } + }); + if (transforms.length > 0) passes.push(this.compile(transforms)); + return passes; +}; + +GlslSource.prototype.compile = function (transforms) { + var shaderInfo = (0, _generateGlsl.default)(transforms, this.synth); + var uniforms = {}; + shaderInfo.uniforms.forEach(uniform => { + uniforms[uniform.name] = uniform.value; + }); + var frag = ` + precision ${this.defaultOutput.precision} float; + ${Object.values(shaderInfo.uniforms).map(uniform => { + let type = uniform.type; + + switch (uniform.type) { + case 'texture': + type = 'sampler2D'; + break; + } + + return ` + uniform ${type} ${uniform.name};`; + }).join('')} + uniform float time; + uniform vec2 resolution; + varying vec2 uv; + uniform sampler2D prevBuffer; + + ${Object.values(_utilityFunctions.default).map(transform => { + // console.log(transform.glsl) + return ` + ${transform.glsl} + `; + }).join('')} + + ${shaderInfo.glslFunctions.map(transform => { + return ` + ${transform.transform.glsl} + `; + }).join('')} + + void main () { + vec4 c = vec4(1, 0, 0, 1); + vec2 st = gl_FragCoord.xy/resolution.xy; + gl_FragColor = ${shaderInfo.fragColor}; + } + `; + return { + frag: frag, + uniforms: Object.assign({}, this.defaultUniforms, uniforms) + }; +}; + +var _default = GlslSource; +exports.default = _default; + +},{"./generate-glsl.js":12,"./glsl/utility-functions.js":16}],15:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/* +Format for adding functions to hydra. For each entry in this file, hydra automatically generates a glsl function and javascript function with the same name. You can also ass functions dynamically using setFunction(object). + +{ + name: 'osc', // name that will be used to access function in js as well as in glsl + type: 'src', // can be 'src', 'color', 'combine', 'combineCoords'. see below for more info + inputs: [ + { + name: 'freq', + type: 'float', + default: 0.2 + }, + { + name: 'sync', + type: 'float', + default: 0.1 + }, + { + name: 'offset', + type: 'float', + default: 0.0 + } + ], + glsl: ` + vec2 st = _st; + float r = sin((st.x-offset*2/freq+time*sync)*freq)*0.5 + 0.5; + float g = sin((st.x+time*sync)*freq)*0.5 + 0.5; + float b = sin((st.x+offset/freq+time*sync)*freq)*0.5 + 0.5; + return vec4(r, g, b, 1.0); + ` +} + +// The above code generates the glsl function: +`vec4 osc(vec2 _st, float freq, float sync, float offset){ + vec2 st = _st; + float r = sin((st.x-offset*2/freq+time*sync)*freq)*0.5 + 0.5; + float g = sin((st.x+time*sync)*freq)*0.5 + 0.5; + float b = sin((st.x+offset/freq+time*sync)*freq)*0.5 + 0.5; + return vec4(r, g, b, 1.0); +}` + + +Types and default arguments for hydra functions. +The value in the 'type' field lets the parser know which type the function will be returned as well as default arguments. + +const types = { + 'src': { + returnType: 'vec4', + args: ['vec2 _st'] + }, + 'coord': { + returnType: 'vec2', + args: ['vec2 _st'] + }, + 'color': { + returnType: 'vec4', + args: ['vec4 _c0'] + }, + 'combine': { + returnType: 'vec4', + args: ['vec4 _c0', 'vec4 _c1'] + }, + 'combineCoord': { + returnType: 'vec2', + args: ['vec2 _st', 'vec4 _c0'] + } +} + +*/ +var _default = () => [{ + name: 'noise', + type: 'src', + inputs: [{ + type: 'float', + name: 'scale', + default: 10 + }, { + type: 'float', + name: 'offset', + default: 0.1 + }], + glsl: ` return vec4(vec3(_noise(vec3(_st*scale, offset*time))), 1.0);` +}, { + name: 'voronoi', + type: 'src', + inputs: [{ + type: 'float', + name: 'scale', + default: 5 + }, { + type: 'float', + name: 'speed', + default: 0.3 + }, { + type: 'float', + name: 'blending', + default: 0.3 + }], + glsl: ` vec3 color = vec3(.0); + // Scale + _st *= scale; + // Tile the space + vec2 i_st = floor(_st); + vec2 f_st = fract(_st); + float m_dist = 10.; // minimun distance + vec2 m_point; // minimum point + for (int j=-1; j<=1; j++ ) { + for (int i=-1; i<=1; i++ ) { + vec2 neighbor = vec2(float(i),float(j)); + vec2 p = i_st + neighbor; + vec2 point = fract(sin(vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3))))*43758.5453); + point = 0.5 + 0.5*sin(time*speed + 6.2831*point); + vec2 diff = neighbor + point - f_st; + float dist = length(diff); + if( dist < m_dist ) { + m_dist = dist; + m_point = point; + } + } + } + // Assign a color using the closest point position + color += dot(m_point,vec2(.3,.6)); + color *= 1.0 - blending*m_dist; + return vec4(color, 1.0);` +}, { + name: 'osc', + type: 'src', + inputs: [{ + type: 'float', + name: 'frequency', + default: 60 + }, { + type: 'float', + name: 'sync', + default: 0.1 + }, { + type: 'float', + name: 'offset', + default: 0 + }], + glsl: ` vec2 st = _st; + float r = sin((st.x-offset/frequency+time*sync)*frequency)*0.5 + 0.5; + float g = sin((st.x+time*sync)*frequency)*0.5 + 0.5; + float b = sin((st.x+offset/frequency+time*sync)*frequency)*0.5 + 0.5; + return vec4(r, g, b, 1.0);` +}, { + name: 'shape', + type: 'src', + inputs: [{ + type: 'float', + name: 'sides', + default: 3 + }, { + type: 'float', + name: 'radius', + default: 0.3 + }, { + type: 'float', + name: 'smoothing', + default: 0.01 + }], + glsl: ` vec2 st = _st * 2. - 1.; + // Angle and radius from the current pixel + float a = atan(st.x,st.y)+3.1416; + float r = (2.*3.1416)/sides; + float d = cos(floor(.5+a/r)*r-a)*length(st); + return vec4(vec3(1.0-smoothstep(radius,radius + smoothing + 0.0000001,d)), 1.0);` +}, { + name: 'gradient', + type: 'src', + inputs: [{ + type: 'float', + name: 'speed', + default: 0 + }], + glsl: ` return vec4(_st, sin(time*speed), 1.0);` +}, { + name: 'src', + type: 'src', + inputs: [{ + type: 'sampler2D', + name: 'tex', + default: NaN + }], + glsl: ` // vec2 uv = gl_FragCoord.xy/vec2(1280., 720.); + return texture2D(tex, fract(_st));` +}, { + name: 'solid', + type: 'src', + inputs: [{ + type: 'float', + name: 'r', + default: 0 + }, { + type: 'float', + name: 'g', + default: 0 + }, { + type: 'float', + name: 'b', + default: 0 + }, { + type: 'float', + name: 'a', + default: 1 + }], + glsl: ` return vec4(r, g, b, a);` +}, { + name: 'rotate', + type: 'coord', + inputs: [{ + type: 'float', + name: 'angle', + default: 10 + }, { + type: 'float', + name: 'speed', + default: 0 + }], + glsl: ` vec2 xy = _st - vec2(0.5); + float ang = angle + speed *time; + xy = mat2(cos(ang),-sin(ang), sin(ang),cos(ang))*xy; + xy += 0.5; + return xy;` +}, { + name: 'scale', + type: 'coord', + inputs: [{ + type: 'float', + name: 'amount', + default: 1.5 + }, { + type: 'float', + name: 'xMult', + default: 1 + }, { + type: 'float', + name: 'yMult', + default: 1 + }, { + type: 'float', + name: 'offsetX', + default: 0.5 + }, { + type: 'float', + name: 'offsetY', + default: 0.5 + }], + glsl: ` vec2 xy = _st - vec2(offsetX, offsetY); + xy*=(1.0/vec2(amount*xMult, amount*yMult)); + xy+=vec2(offsetX, offsetY); + return xy; + ` +}, { + name: 'pixelate', + type: 'coord', + inputs: [{ + type: 'float', + name: 'pixelX', + default: 20 + }, { + type: 'float', + name: 'pixelY', + default: 20 + }], + glsl: ` vec2 xy = vec2(pixelX, pixelY); + return (floor(_st * xy) + 0.5)/xy;` +}, { + name: 'posterize', + type: 'color', + inputs: [{ + type: 'float', + name: 'bins', + default: 3 + }, { + type: 'float', + name: 'gamma', + default: 0.6 + }], + glsl: ` vec4 c2 = pow(_c0, vec4(gamma)); + c2 *= vec4(bins); + c2 = floor(c2); + c2/= vec4(bins); + c2 = pow(c2, vec4(1.0/gamma)); + return vec4(c2.xyz, _c0.a);` +}, { + name: 'shift', + type: 'color', + inputs: [{ + type: 'float', + name: 'r', + default: 0.5 + }, { + type: 'float', + name: 'g', + default: 0 + }, { + type: 'float', + name: 'b', + default: 0 + }, { + type: 'float', + name: 'a', + default: 0 + }], + glsl: ` vec4 c2 = vec4(_c0); + c2.r = fract(c2.r + r); + c2.g = fract(c2.g + g); + c2.b = fract(c2.b + b); + c2.a = fract(c2.a + a); + return vec4(c2.rgba);` +}, { + name: 'repeat', + type: 'coord', + inputs: [{ + type: 'float', + name: 'repeatX', + default: 3 + }, { + type: 'float', + name: 'repeatY', + default: 3 + }, { + type: 'float', + name: 'offsetX', + default: 0 + }, { + type: 'float', + name: 'offsetY', + default: 0 + }], + glsl: ` vec2 st = _st * vec2(repeatX, repeatY); + st.x += step(1., mod(st.y,2.0)) * offsetX; + st.y += step(1., mod(st.x,2.0)) * offsetY; + return fract(st);` +}, { + name: 'modulateRepeat', + type: 'combineCoord', + inputs: [{ + type: 'float', + name: 'repeatX', + default: 3 + }, { + type: 'float', + name: 'repeatY', + default: 3 + }, { + type: 'float', + name: 'offsetX', + default: 0.5 + }, { + type: 'float', + name: 'offsetY', + default: 0.5 + }], + glsl: ` vec2 st = _st * vec2(repeatX, repeatY); + st.x += step(1., mod(st.y,2.0)) + _c0.r * offsetX; + st.y += step(1., mod(st.x,2.0)) + _c0.g * offsetY; + return fract(st);` +}, { + name: 'repeatX', + type: 'coord', + inputs: [{ + type: 'float', + name: 'reps', + default: 3 + }, { + type: 'float', + name: 'offset', + default: 0 + }], + glsl: ` vec2 st = _st * vec2(reps, 1.0); + // float f = mod(_st.y,2.0); + st.y += step(1., mod(st.x,2.0))* offset; + return fract(st);` +}, { + name: 'modulateRepeatX', + type: 'combineCoord', + inputs: [{ + type: 'float', + name: 'reps', + default: 3 + }, { + type: 'float', + name: 'offset', + default: 0.5 + }], + glsl: ` vec2 st = _st * vec2(reps, 1.0); + // float f = mod(_st.y,2.0); + st.y += step(1., mod(st.x,2.0)) + _c0.r * offset; + return fract(st);` +}, { + name: 'repeatY', + type: 'coord', + inputs: [{ + type: 'float', + name: 'reps', + default: 3 + }, { + type: 'float', + name: 'offset', + default: 0 + }], + glsl: ` vec2 st = _st * vec2(1.0, reps); + // float f = mod(_st.y,2.0); + st.x += step(1., mod(st.y,2.0))* offset; + return fract(st);` +}, { + name: 'modulateRepeatY', + type: 'combineCoord', + inputs: [{ + type: 'float', + name: 'reps', + default: 3 + }, { + type: 'float', + name: 'offset', + default: 0.5 + }], + glsl: ` vec2 st = _st * vec2(reps, 1.0); + // float f = mod(_st.y,2.0); + st.x += step(1., mod(st.y,2.0)) + _c0.r * offset; + return fract(st);` +}, { + name: 'kaleid', + type: 'coord', + inputs: [{ + type: 'float', + name: 'nSides', + default: 4 + }], + glsl: ` vec2 st = _st; + st -= 0.5; + float r = length(st); + float a = atan(st.y, st.x); + float pi = 2.*3.1416; + a = mod(a,pi/nSides); + a = abs(a-pi/nSides/2.); + return r*vec2(cos(a), sin(a));` +}, { + name: 'modulateKaleid', + type: 'combineCoord', + inputs: [{ + type: 'float', + name: 'nSides', + default: 4 + }], + glsl: ` vec2 st = _st - 0.5; + float r = length(st); + float a = atan(st.y, st.x); + float pi = 2.*3.1416; + a = mod(a,pi/nSides); + a = abs(a-pi/nSides/2.); + return (_c0.r+r)*vec2(cos(a), sin(a));` +}, { + name: 'scroll', + type: 'coord', + inputs: [{ + type: 'float', + name: 'scrollX', + default: 0.5 + }, { + type: 'float', + name: 'scrollY', + default: 0.5 + }, { + type: 'float', + name: 'speedX', + default: 0 + }, { + type: 'float', + name: 'speedY', + default: 0 + }], + glsl: ` + _st.x += scrollX + time*speedX; + _st.y += scrollY + time*speedY; + return fract(_st);` +}, { + name: 'scrollX', + type: 'coord', + inputs: [{ + type: 'float', + name: 'scrollX', + default: 0.5 + }, { + type: 'float', + name: 'speed', + default: 0 + }], + glsl: ` _st.x += scrollX + time*speed; + return fract(_st);` +}, { + name: 'modulateScrollX', + type: 'combineCoord', + inputs: [{ + type: 'float', + name: 'scrollX', + default: 0.5 + }, { + type: 'float', + name: 'speed', + default: 0 + }], + glsl: ` _st.x += _c0.r*scrollX + time*speed; + return fract(_st);` +}, { + name: 'scrollY', + type: 'coord', + inputs: [{ + type: 'float', + name: 'scrollY', + default: 0.5 + }, { + type: 'float', + name: 'speed', + default: 0 + }], + glsl: ` _st.y += scrollY + time*speed; + return fract(_st);` +}, { + name: 'modulateScrollY', + type: 'combineCoord', + inputs: [{ + type: 'float', + name: 'scrollY', + default: 0.5 + }, { + type: 'float', + name: 'speed', + default: 0 + }], + glsl: ` _st.y += _c0.r*scrollY + time*speed; + return fract(_st);` +}, { + name: 'add', + type: 'combine', + inputs: [{ + type: 'float', + name: 'amount', + default: 1 + }], + glsl: ` return (_c0+_c1)*amount + _c0*(1.0-amount);` +}, { + name: 'sub', + type: 'combine', + inputs: [{ + type: 'float', + name: 'amount', + default: 1 + }], + glsl: ` return (_c0-_c1)*amount + _c0*(1.0-amount);` +}, { + name: 'layer', + type: 'combine', + inputs: [], + glsl: ` return vec4(mix(_c0.rgb, _c1.rgb, _c1.a), clamp(_c0.a + _c1.a, 0.0, 1.0));` +}, { + name: 'blend', + type: 'combine', + inputs: [{ + type: 'float', + name: 'amount', + default: 0.5 + }], + glsl: ` return _c0*(1.0-amount)+_c1*amount;` +}, { + name: 'mult', + type: 'combine', + inputs: [{ + type: 'float', + name: 'amount', + default: 1 + }], + glsl: ` return _c0*(1.0-amount)+(_c0*_c1)*amount;` +}, { + name: 'diff', + type: 'combine', + inputs: [], + glsl: ` return vec4(abs(_c0.rgb-_c1.rgb), max(_c0.a, _c1.a));` +}, { + name: 'modulate', + type: 'combineCoord', + inputs: [{ + type: 'float', + name: 'amount', + default: 0.1 + }], + glsl: ` // return fract(st+(_c0.xy-0.5)*amount); + return _st + _c0.xy*amount;` +}, { + name: 'modulateScale', + type: 'combineCoord', + inputs: [{ + type: 'float', + name: 'multiple', + default: 1 + }, { + type: 'float', + name: 'offset', + default: 1 + }], + glsl: ` vec2 xy = _st - vec2(0.5); + xy*=(1.0/vec2(offset + multiple*_c0.r, offset + multiple*_c0.g)); + xy+=vec2(0.5); + return xy;` +}, { + name: 'modulatePixelate', + type: 'combineCoord', + inputs: [{ + type: 'float', + name: 'multiple', + default: 10 + }, { + type: 'float', + name: 'offset', + default: 3 + }], + glsl: ` vec2 xy = vec2(offset + _c0.x*multiple, offset + _c0.y*multiple); + return (floor(_st * xy) + 0.5)/xy;` +}, { + name: 'modulateRotate', + type: 'combineCoord', + inputs: [{ + type: 'float', + name: 'multiple', + default: 1 + }, { + type: 'float', + name: 'offset', + default: 0 + }], + glsl: ` vec2 xy = _st - vec2(0.5); + float angle = offset + _c0.x * multiple; + xy = mat2(cos(angle),-sin(angle), sin(angle),cos(angle))*xy; + xy += 0.5; + return xy;` +}, { + name: 'modulateHue', + type: 'combineCoord', + inputs: [{ + type: 'float', + name: 'amount', + default: 1 + }], + glsl: ` return _st + (vec2(_c0.g - _c0.r, _c0.b - _c0.g) * amount * 1.0/resolution);` +}, { + name: 'invert', + type: 'color', + inputs: [{ + type: 'float', + name: 'amount', + default: 1 + }], + glsl: ` return vec4((1.0-_c0.rgb)*amount + _c0.rgb*(1.0-amount), _c0.a);` +}, { + name: 'contrast', + type: 'color', + inputs: [{ + type: 'float', + name: 'amount', + default: 1.6 + }], + glsl: ` vec4 c = (_c0-vec4(0.5))*vec4(amount) + vec4(0.5); + return vec4(c.rgb, _c0.a);` +}, { + name: 'brightness', + type: 'color', + inputs: [{ + type: 'float', + name: 'amount', + default: 0.4 + }], + glsl: ` return vec4(_c0.rgb + vec3(amount), _c0.a);` +}, { + name: 'mask', + type: 'combine', + inputs: [], + glsl: ` float a = _luminance(_c1.rgb); + return vec4(_c0.rgb*a, a*_c0.a);` +}, { + name: 'luma', + type: 'color', + inputs: [{ + type: 'float', + name: 'threshold', + default: 0.5 + }, { + type: 'float', + name: 'tolerance', + default: 0.1 + }], + glsl: ` float a = smoothstep(threshold-(tolerance+0.0000001), threshold+(tolerance+0.0000001), _luminance(_c0.rgb)); + return vec4(_c0.rgb*a, a);` +}, { + name: 'thresh', + type: 'color', + inputs: [{ + type: 'float', + name: 'threshold', + default: 0.5 + }, { + type: 'float', + name: 'tolerance', + default: 0.04 + }], + glsl: ` return vec4(vec3(smoothstep(threshold-(tolerance+0.0000001), threshold+(tolerance+0.0000001), _luminance(_c0.rgb))), _c0.a);` +}, { + name: 'color', + type: 'color', + inputs: [{ + type: 'float', + name: 'r', + default: 1 + }, { + type: 'float', + name: 'g', + default: 1 + }, { + type: 'float', + name: 'b', + default: 1 + }, { + type: 'float', + name: 'a', + default: 1 + }], + glsl: ` vec4 c = vec4(r, g, b, a); + vec4 pos = step(0.0, c); // detect whether negative + // if > 0, return r * _c0 + // if < 0 return (1.0-r) * _c0 + return vec4(mix((1.0-_c0)*abs(c), c*_c0, pos));` +}, { + name: 'saturate', + type: 'color', + inputs: [{ + type: 'float', + name: 'amount', + default: 2 + }], + glsl: ` const vec3 W = vec3(0.2125, 0.7154, 0.0721); + vec3 intensity = vec3(dot(_c0.rgb, W)); + return vec4(mix(intensity, _c0.rgb, amount), _c0.a);` +}, { + name: 'hue', + type: 'color', + inputs: [{ + type: 'float', + name: 'hue', + default: 0.4 + }], + glsl: ` vec3 c = _rgbToHsv(_c0.rgb); + c.r += hue; + // c.r = fract(c.r); + return vec4(_hsvToRgb(c), _c0.a);` +}, { + name: 'colorama', + type: 'color', + inputs: [{ + type: 'float', + name: 'amount', + default: 0.005 + }], + glsl: ` vec3 c = _rgbToHsv(_c0.rgb); + c += vec3(amount); + c = _hsvToRgb(c); + c = fract(c); + return vec4(c, _c0.a);` +}, { + name: 'prev', + type: 'src', + inputs: [], + glsl: ` return texture2D(prevBuffer, fract(_st));` +}, { + name: 'sum', + type: 'color', + inputs: [{ + type: 'vec4', + name: 'scale', + default: 1 + }], + glsl: ` vec4 v = _c0 * s; + return v.r + v.g + v.b + v.a; + } + float sum(vec2 _st, vec4 s) { // vec4 is not a typo, because argument type is not overloaded + vec2 v = _st.xy * s.xy; + return v.x + v.y;` +}, { + name: 'r', + type: 'color', + inputs: [{ + type: 'float', + name: 'scale', + default: 1 + }, { + type: 'float', + name: 'offset', + default: 0 + }], + glsl: ` return vec4(_c0.r * scale + offset);` +}, { + name: 'g', + type: 'color', + inputs: [{ + type: 'float', + name: 'scale', + default: 1 + }, { + type: 'float', + name: 'offset', + default: 0 + }], + glsl: ` return vec4(_c0.g * scale + offset);` +}, { + name: 'b', + type: 'color', + inputs: [{ + type: 'float', + name: 'scale', + default: 1 + }, { + type: 'float', + name: 'offset', + default: 0 + }], + glsl: ` return vec4(_c0.b * scale + offset);` +}, { + name: 'a', + type: 'color', + inputs: [{ + type: 'float', + name: 'scale', + default: 1 + }, { + type: 'float', + name: 'offset', + default: 0 + }], + glsl: ` return vec4(_c0.a * scale + offset);` +}]; + +exports.default = _default; + +},{}],16:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +// functions that are only used within other functions +var _default = { + _luminance: { + type: 'util', + glsl: `float _luminance(vec3 rgb){ + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + return dot(rgb, W); + }` + }, + _noise: { + type: 'util', + glsl: ` + // Simplex 3D Noise + // by Ian McEwan, Ashima Arts + vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);} + vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;} + + float _noise(vec3 v){ + const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; + const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); + + // First corner + vec3 i = floor(v + dot(v, C.yyy) ); + vec3 x0 = v - i + dot(i, C.xxx) ; + + // Other corners + vec3 g = step(x0.yzx, x0.xyz); + vec3 l = 1.0 - g; + vec3 i1 = min( g.xyz, l.zxy ); + vec3 i2 = max( g.xyz, l.zxy ); + + // x0 = x0 - 0. + 0.0 * C + vec3 x1 = x0 - i1 + 1.0 * C.xxx; + vec3 x2 = x0 - i2 + 2.0 * C.xxx; + vec3 x3 = x0 - 1. + 3.0 * C.xxx; + + // Permutations + i = mod(i, 289.0 ); + vec4 p = permute( permute( permute( + i.z + vec4(0.0, i1.z, i2.z, 1.0 )) + + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) + + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); + + // Gradients + // ( N*N points uniformly over a square, mapped onto an octahedron.) + float n_ = 1.0/7.0; // N=7 + vec3 ns = n_ * D.wyz - D.xzx; + + vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) + + vec4 x_ = floor(j * ns.z); + vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) + + vec4 x = x_ *ns.x + ns.yyyy; + vec4 y = y_ *ns.x + ns.yyyy; + vec4 h = 1.0 - abs(x) - abs(y); + + vec4 b0 = vec4( x.xy, y.xy ); + vec4 b1 = vec4( x.zw, y.zw ); + + vec4 s0 = floor(b0)*2.0 + 1.0; + vec4 s1 = floor(b1)*2.0 + 1.0; + vec4 sh = -step(h, vec4(0.0)); + + vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; + vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; + + vec3 p0 = vec3(a0.xy,h.x); + vec3 p1 = vec3(a0.zw,h.y); + vec3 p2 = vec3(a1.xy,h.z); + vec3 p3 = vec3(a1.zw,h.w); + + //Normalise gradients + vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); + p0 *= norm.x; + p1 *= norm.y; + p2 *= norm.z; + p3 *= norm.w; + + // Mix final noise value + vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); + m = m * m; + return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), + dot(p2,x2), dot(p3,x3) ) ); + } + ` + }, + _rgbToHsv: { + type: 'util', + glsl: `vec3 _rgbToHsv(vec3 c){ + vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); + vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); + vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); + + float d = q.x - min(q.w, q.y); + float e = 1.0e-10; + return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); + }` + }, + _hsvToRgb: { + type: 'util', + glsl: `vec3 _hsvToRgb(vec3 c){ + vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); + return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); + }` + } +}; +exports.default = _default; + +},{}],17:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _webcam = _interopRequireDefault(require("./lib/webcam.js")); + +var _screenmedia = _interopRequireDefault(require("./lib/screenmedia.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +class HydraSource { + constructor({ + regl, + width, + height, + pb, + label = "" + }) { + this.label = label; + this.regl = regl; + this.src = null; + this.dynamic = true; + this.width = width; + this.height = height; + this.tex = this.regl.texture({ + // shape: [width, height] + shape: [1, 1] + }); + this.pb = pb; + } + + init(opts, params) { + if ('src' in opts) { + this.src = opts.src; + this.tex = this.regl.texture({ + data: this.src, + ...params + }); + } + + if ('dynamic' in opts) this.dynamic = opts.dynamic; + } + + initCam(index, params) { + const self = this; + (0, _webcam.default)(index).then(response => { + self.src = response.video; + self.dynamic = true; + self.tex = self.regl.texture({ + data: self.src, + ...params + }); + }).catch(err => console.log('could not get camera', err)); + } + + initVideo(url = '', params) { + // const self = this + const vid = document.createElement('video'); + vid.crossOrigin = 'anonymous'; + vid.autoplay = true; + vid.loop = true; + vid.muted = true; // mute in order to load without user interaction + + const onload = vid.addEventListener('loadeddata', () => { + this.src = vid; + vid.play(); + this.tex = this.regl.texture({ + data: this.src, + ...params + }); + this.dynamic = true; + }); + vid.src = url; + } + + initImage(url = '', params) { + const img = document.createElement('img'); + img.crossOrigin = 'anonymous'; + img.src = url; + + img.onload = () => { + this.src = img; + this.dynamic = false; + this.tex = this.regl.texture({ + data: this.src, + ...params + }); + }; + } + + initStream(streamName, params) { + // console.log("initing stream!", streamName) + let self = this; + + if (streamName && this.pb) { + this.pb.initSource(streamName); + this.pb.on('got video', function (nick, video) { + if (nick === streamName) { + self.src = video; + self.dynamic = true; + self.tex = self.regl.texture({ + data: self.src, + ...params + }); + } + }); + } + } // index only relevant in atom-hydra + desktop apps + + + initScreen(index = 0, params) { + const self = this; + (0, _screenmedia.default)().then(function (response) { + self.src = response.video; + self.tex = self.regl.texture({ + data: self.src, + ...params + }); + self.dynamic = true; // console.log("received screen input") + }).catch(err => console.log('could not get screen', err)); + } + + resize(width, height) { + this.width = width; + this.height = height; + } + + clear() { + if (this.src && this.src.srcObject) { + if (this.src.srcObject.getTracks) { + this.src.srcObject.getTracks().forEach(track => track.stop()); + } + } + + this.src = null; + this.tex = this.regl.texture({ + shape: [1, 1] + }); + } + + tick(time) { + // console.log(this.src, this.tex.width, this.tex.height) + if (this.src !== null && this.dynamic === true) { + if (this.src.videoWidth && this.src.videoWidth !== this.tex.width) { + console.log(this.src.videoWidth, this.src.videoHeight, this.tex.width, this.tex.height); + this.tex.resize(this.src.videoWidth, this.src.videoHeight); + } + + if (this.src.width && this.src.width !== this.tex.width) { + this.tex.resize(this.src.width, this.src.height); + } + + this.tex.subimage(this.src); + } + } + + getTexture() { + return this.tex; + } + +} + +var _default = HydraSource; +exports.default = _default; + +},{"./lib/screenmedia.js":26,"./lib/webcam.js":28}],18:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _output = _interopRequireDefault(require("./output.js")); + +var _rafLoop = _interopRequireDefault(require("raf-loop")); + +var _hydraSource = _interopRequireDefault(require("./hydra-source.js")); + +var _mouse = _interopRequireDefault(require("./lib/mouse.js")); + +var _audio = _interopRequireDefault(require("./lib/audio.js")); + +var _videoRecorder = _interopRequireDefault(require("./lib/video-recorder.js")); + +var _arrayUtils = _interopRequireDefault(require("./lib/array-utils.js")); + +var _evalSandbox = _interopRequireDefault(require("./eval-sandbox.js")); + +var _generatorFactory = _interopRequireDefault(require("./generator-factory.js")); + +var _regl = _interopRequireDefault(require("regl")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// import strudel from './lib/strudel.js' +// const window = global.window +const Mouse = (0, _mouse.default)(); // to do: add ability to pass in certain uniforms and transforms + +class HydraRenderer { + constructor({ + pb = null, + width = 1280, + height = 720, + numSources = 4, + numOutputs = 4, + makeGlobal = true, + autoLoop = true, + detectAudio = true, + enableStreamCapture = true, + canvas, + precision, + extendTransforms = {} // add your own functions on init + + } = {}) { + _arrayUtils.default.init(); + + this.pb = pb; + this.width = width; + this.height = height; + this.renderAll = false; + this.detectAudio = detectAudio; + + this._initCanvas(canvas); //global.window.test = 'hi' + // object that contains all properties that will be made available on the global context and during local evaluation + + + this.synth = { + time: 0, + bpm: 30, + width: this.width, + height: this.height, + fps: undefined, + stats: { + fps: 0 + }, + speed: 1, + mouse: Mouse, + render: this._render.bind(this), + setResolution: this.setResolution.bind(this), + update: dt => {}, + // user defined update function + hush: this.hush.bind(this), + tick: this.tick.bind(this) + }; + if (makeGlobal) window.loadScript = this.loadScript; + this.timeSinceLastUpdate = 0; + this._time = 0; // for internal use, only to use for deciding when to render frames + // only allow valid precision options + + let precisionOptions = ['lowp', 'mediump', 'highp']; + + if (precision && precisionOptions.includes(precision.toLowerCase())) { + this.precision = precision.toLowerCase(); // + // if(!precisionValid){ + // console.warn('[hydra-synth warning]\nConstructor was provided an invalid floating point precision value of "' + precision + '". Using default value of "mediump" instead.') + // } + } else { + let isIOS = (/iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1) && !window.MSStream; + this.precision = isIOS ? 'highp' : 'mediump'; + } + + this.extendTransforms = extendTransforms; // boolean to store when to save screenshot + + this.saveFrame = false; // if stream capture is enabled, this object contains the capture stream + + this.captureStream = null; + this.generator = undefined; + + this._initRegl(); + + this._initOutputs(numOutputs); + + this._initSources(numSources); + + this._generateGlslTransforms(); + + this.synth.screencap = () => { + this.saveFrame = true; + }; + + if (enableStreamCapture) { + try { + this.captureStream = this.canvas.captureStream(25); // to do: enable capture stream of specific sources and outputs + + this.synth.vidRecorder = new _videoRecorder.default(this.captureStream); + } catch (e) { + console.warn('[hydra-synth warning]\nnew MediaSource() is not currently supported on iOS.'); + console.error(e); + } + } + + if (detectAudio) this._initAudio(); + if (autoLoop) (0, _rafLoop.default)(this.tick.bind(this)).start(); // final argument is properties that the user can set, all others are treated as read-only + + this.sandbox = new _evalSandbox.default(this.synth, makeGlobal, ['speed', 'update', 'bpm', 'fps']); + } + + eval(code) { + this.sandbox.eval(code); + } + + getScreenImage(callback) { + this.imageCallback = callback; + this.saveFrame = true; + } + + hush() { + this.s.forEach(source => { + source.clear(); + }); + this.o.forEach(output => { + this.synth.solid(0, 0, 0, 0).out(output); + }); + this.synth.render(this.o[0]); // this.synth.update = (dt) => {} + + this.sandbox.set('update', dt => {}); + } + + loadScript(url = "") { + const p = new Promise((res, rej) => { + var script = document.createElement("script"); + + script.onload = function () { + console.log(`loaded script ${url}`); + res(); + }; + + script.onerror = err => { + console.log(`error loading script ${url}`, "log-error"); + res(); + }; + + script.src = url; + document.head.appendChild(script); + }); + return p; + } + + setResolution(width, height) { + // console.log(width, height) + this.canvas.width = width; + this.canvas.height = height; + this.width = width; // is this necessary? + + this.height = height; // ? + + this.sandbox.set('width', width); + this.sandbox.set('height', height); + console.log(this.width); + this.o.forEach(output => { + output.resize(width, height); + }); + this.s.forEach(source => { + source.resize(width, height); + }); + + this.regl._refresh(); + + console.log(this.canvas.width); + } + + canvasToImage(callback) { + const a = document.createElement('a'); + a.style.display = 'none'; + let d = new Date(); + a.download = `hydra-${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}-${d.getHours()}.${d.getMinutes()}.${d.getSeconds()}.png`; + document.body.appendChild(a); + var self = this; + this.canvas.toBlob(blob => { + if (self.imageCallback) { + self.imageCallback(blob); + delete self.imageCallback; + } else { + a.href = URL.createObjectURL(blob); + console.log(a.href); + a.click(); + } + }, 'image/png'); + setTimeout(() => { + document.body.removeChild(a); + window.URL.revokeObjectURL(a.href); + }, 300); + } + + _initAudio() { + const that = this; + this.synth.a = new _audio.default({ + numBins: 4, + parentEl: this.canvas.parentNode // changeListener: ({audio}) => { + // that.a = audio.bins.map((_, index) => + // (scale = 1, offset = 0) => () => (audio.fft[index] * scale + offset) + // ) + // + // if (that.makeGlobal) { + // that.a.forEach((a, index) => { + // const aname = `a${index}` + // window[aname] = a + // }) + // } + // } + + }); + } // create main output canvas and add to screen + + + _initCanvas(canvas) { + if (canvas) { + this.canvas = canvas; + this.width = canvas.width; + this.height = canvas.height; + } else { + this.canvas = document.createElement('canvas'); + this.canvas.width = this.width; + this.canvas.height = this.height; + this.canvas.style.width = '100%'; + this.canvas.style.height = '100%'; + this.canvas.style.imageRendering = 'pixelated'; + document.body.appendChild(this.canvas); + } + } + + _initRegl() { + this.regl = (0, _regl.default)({ + // profile: true, + canvas: this.canvas, + pixelRatio: 1 //, + // extensions: [ + // 'oes_texture_half_float', + // 'oes_texture_half_float_linear' + // ], + // optionalExtensions: [ + // 'oes_texture_float', + // 'oes_texture_float_linear' + //] + + }); // This clears the color buffer to black and the depth buffer to 1 + + this.regl.clear({ + color: [0, 0, 0, 1] + }); + this.renderAll = this.regl({ + frag: ` + precision ${this.precision} float; + varying vec2 uv; + uniform sampler2D tex0; + uniform sampler2D tex1; + uniform sampler2D tex2; + uniform sampler2D tex3; + + void main () { + vec2 st = vec2(1.0 - uv.x, uv.y); + st*= vec2(2); + vec2 q = floor(st).xy*(vec2(2.0, 1.0)); + int quad = int(q.x) + int(q.y); + st.x += step(1., mod(st.y,2.0)); + st.y += step(1., mod(st.x,2.0)); + st = fract(st); + if(quad==0){ + gl_FragColor = texture2D(tex0, st); + } else if(quad==1){ + gl_FragColor = texture2D(tex1, st); + } else if (quad==2){ + gl_FragColor = texture2D(tex2, st); + } else { + gl_FragColor = texture2D(tex3, st); + } + + } + `, + vert: ` + precision ${this.precision} float; + attribute vec2 position; + varying vec2 uv; + + void main () { + uv = position; + gl_Position = vec4(1.0 - 2.0 * position, 0, 1); + }`, + attributes: { + position: [[-2, 0], [0, -2], [2, 2]] + }, + uniforms: { + tex0: this.regl.prop('tex0'), + tex1: this.regl.prop('tex1'), + tex2: this.regl.prop('tex2'), + tex3: this.regl.prop('tex3') + }, + count: 3, + depth: { + enable: false + } + }); + this.renderFbo = this.regl({ + frag: ` + precision ${this.precision} float; + varying vec2 uv; + uniform vec2 resolution; + uniform sampler2D tex0; + + void main () { + gl_FragColor = texture2D(tex0, vec2(1.0 - uv.x, uv.y)); + } + `, + vert: ` + precision ${this.precision} float; + attribute vec2 position; + varying vec2 uv; + + void main () { + uv = position; + gl_Position = vec4(1.0 - 2.0 * position, 0, 1); + }`, + attributes: { + position: [[-2, 0], [0, -2], [2, 2]] + }, + uniforms: { + tex0: this.regl.prop('tex0'), + resolution: this.regl.prop('resolution') + }, + count: 3, + depth: { + enable: false + } + }); + } + + _initOutputs(numOutputs) { + const self = this; + this.o = Array(numOutputs).fill().map((el, index) => { + var o = new _output.default({ + regl: this.regl, + width: this.width, + height: this.height, + precision: this.precision, + label: `o${index}` + }); // o.render() + + o.id = index; + self.synth['o' + index] = o; + return o; + }); // set default output + + this.output = this.o[0]; + } + + _initSources(numSources) { + this.s = []; + + for (var i = 0; i < numSources; i++) { + this.createSource(i); + } + } + + createSource(i) { + let s = new _hydraSource.default({ + regl: this.regl, + pb: this.pb, + width: this.width, + height: this.height, + label: `s${i}` + }); + this.synth['s' + this.s.length] = s; + this.s.push(s); + return s; + } + + _generateGlslTransforms() { + var self = this; + this.generator = new _generatorFactory.default({ + defaultOutput: this.o[0], + defaultUniforms: this.o[0].uniforms, + extendTransforms: this.extendTransforms, + changeListener: ({ + type, + method, + synth + }) => { + if (type === 'add') { + self.synth[method] = synth.generators[method]; + if (self.sandbox) self.sandbox.add(method); + } else if (type === 'remove') {// what to do here? dangerously deleting window methods + //delete window[method] + } // } + + } + }); + this.synth.setFunction = this.generator.setFunction.bind(this.generator); + } + + _render(output) { + if (output) { + this.output = output; + this.isRenderingAll = false; + } else { + this.isRenderingAll = true; + } + } // dt in ms + + + tick(dt, uniforms) { + this.sandbox.tick(); + if (this.detectAudio === true) this.synth.a.tick(); // let updateInterval = 1000/this.synth.fps // ms + + this.sandbox.set('time', this.synth.time += dt * 0.001 * this.synth.speed); + this.timeSinceLastUpdate += dt; + + if (!this.synth.fps || this.timeSinceLastUpdate >= 1000 / this.synth.fps) { + // console.log(1000/this.timeSinceLastUpdate) + this.synth.stats.fps = Math.ceil(1000 / this.timeSinceLastUpdate); + + if (this.synth.update) { + try { + this.synth.update(this.timeSinceLastUpdate); + } catch (e) { + console.log(e); + } + } // console.log(this.synth.speed, this.synth.time) + + + for (let i = 0; i < this.s.length; i++) { + this.s[i].tick(this.synth.time); + } // console.log(this.canvas.width, this.canvas.height) + + + for (let i = 0; i < this.o.length; i++) { + this.o[i].tick({ + time: this.synth.time, + mouse: this.synth.mouse, + bpm: this.synth.bpm, + resolution: [this.canvas.width, this.canvas.height] + }); + } + + if (this.isRenderingAll) { + this.renderAll({ + tex0: this.o[0].getCurrent(), + tex1: this.o[1].getCurrent(), + tex2: this.o[2].getCurrent(), + tex3: this.o[3].getCurrent(), + resolution: [this.canvas.width, this.canvas.height] + }); + } else { + this.renderFbo({ + tex0: this.output.getCurrent(), + resolution: [this.canvas.width, this.canvas.height] + }); + } + + this.timeSinceLastUpdate = 0; + } + + if (this.saveFrame === true) { + this.canvasToImage(); + this.saveFrame = false; + } // this.regl.poll() + + } + +} + +var _default = HydraRenderer; +exports.default = _default; + +},{"./eval-sandbox.js":10,"./generator-factory.js":13,"./hydra-source.js":17,"./lib/array-utils.js":20,"./lib/audio.js":21,"./lib/mouse.js":24,"./lib/video-recorder.js":27,"./output.js":29,"raf-loop":6,"regl":8}],19:[function(require,module,exports){ +"use strict"; + +var _hydraSynth = _interopRequireDefault(require("./hydra-synth.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +//import ShaderGenerator = require('./shader-generator.js') +// alert('hi') +// export default Synth +module.exports = _hydraSynth.default; + +},{"./hydra-synth.js":18}],20:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _easingFunctions = _interopRequireDefault(require("./easing-functions.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// WIP utils for working with arrays +// Possibly should be integrated with lfo extension, etc. +// to do: transform time rather than array values, similar to working with coordinates in hydra +var map = (num, in_min, in_max, out_min, out_max) => { + return (num - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; +}; + +var _default = { + init: () => { + Array.prototype.fast = function (speed = 1) { + this._speed = speed; + return this; + }; + + Array.prototype.smooth = function (smooth = 1) { + this._smooth = smooth; + return this; + }; + + Array.prototype.ease = function (ease = 'linear') { + if (typeof ease == 'function') { + this._smooth = 1; + this._ease = ease; + } else if (_easingFunctions.default[ease]) { + this._smooth = 1; + this._ease = _easingFunctions.default[ease]; + } + + return this; + }; + + Array.prototype.offset = function (offset = 0.5) { + this._offset = offset % 1.0; + return this; + }; // Array.prototype.bounce = function() { + // this.modifiers.bounce = true + // return this + // } + + + Array.prototype.fit = function (low = 0, high = 1) { + let lowest = Math.min(...this); + let highest = Math.max(...this); + var newArr = this.map(num => map(num, lowest, highest, low, high)); + newArr._speed = this._speed; + newArr._smooth = this._smooth; + newArr._ease = this._ease; + return newArr; + }; + }, + getValue: (arr = []) => ({ + time, + bpm + }) => { + let speed = arr._speed ? arr._speed : 1; + let smooth = arr._smooth ? arr._smooth : 0; + let index = time * speed * (bpm / 60) + (arr._offset || 0); + + if (smooth !== 0) { + let ease = arr._ease ? arr._ease : _easingFunctions.default['linear']; + + let _index = index - smooth / 2; + + let currValue = arr[Math.floor(_index % arr.length)]; + let nextValue = arr[Math.floor((_index + 1) % arr.length)]; + let t = Math.min(_index % 1 / smooth, 1); + return ease(t) * (nextValue - currValue) + currValue; + } else { + const val = arr[Math.floor(index % arr.length)]; + return arr[Math.floor(index % arr.length)]; + } + } +}; +exports.default = _default; + +},{"./easing-functions.js":22}],21:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _meyda = _interopRequireDefault(require("meyda")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +class Audio { + constructor({ + numBins = 4, + cutoff = 2, + smooth = 0.4, + max = 15, + scale = 10, + isDrawing = false, + parentEl = document.body + }) { + this.vol = 0; + this.scale = scale; + this.max = max; + this.cutoff = cutoff; + this.smooth = smooth; + this.setBins(numBins); // beat detection from: https://github.com/therewasaguy/p5-music-viz/blob/gh-pages/demos/01d_beat_detect_amplitude/sketch.js + + this.beat = { + holdFrames: 20, + threshold: 40, + _cutoff: 0, + // adaptive based on sound state + decay: 0.98, + _framesSinceBeat: 0 // keeps track of frames + + }; + + this.onBeat = () => {// console.log("beat") + }; + + this.canvas = document.createElement('canvas'); + this.canvas.width = 100; + this.canvas.height = 80; + this.canvas.style.width = "100px"; + this.canvas.style.height = "80px"; + this.canvas.style.position = 'absolute'; + this.canvas.style.right = '0px'; + this.canvas.style.bottom = '0px'; + parentEl.appendChild(this.canvas); + this.isDrawing = isDrawing; + this.ctx = this.canvas.getContext('2d'); + this.ctx.fillStyle = "#DFFFFF"; + this.ctx.strokeStyle = "#0ff"; + this.ctx.lineWidth = 0.5; + + if (window.navigator.mediaDevices) { + window.navigator.mediaDevices.getUserMedia({ + video: false, + audio: true + }).then(stream => { + // console.log('got mic stream', stream) + this.stream = stream; + this.context = new AudioContext(); // this.context = new AudioContext() + + let audio_stream = this.context.createMediaStreamSource(stream); // console.log(this.context) + + this.meyda = _meyda.default.createMeydaAnalyzer({ + audioContext: this.context, + source: audio_stream, + featureExtractors: ['loudness' // 'perceptualSpread', + // 'perceptualSharpness', + // 'spectralCentroid' + ] + }); + }).catch(err => console.log('ERROR', err)); + } + } + + detectBeat(level) { + //console.log(level, this.beat._cutoff) + if (level > this.beat._cutoff && level > this.beat.threshold) { + this.onBeat(); + this.beat._cutoff = level * 1.2; + this.beat._framesSinceBeat = 0; + } else { + if (this.beat._framesSinceBeat <= this.beat.holdFrames) { + this.beat._framesSinceBeat++; + } else { + this.beat._cutoff *= this.beat.decay; + this.beat._cutoff = Math.max(this.beat._cutoff, this.beat.threshold); + } + } + } + + tick() { + if (this.meyda) { + var features = this.meyda.get(); + + if (features && features !== null) { + this.vol = features.loudness.total; + this.detectBeat(this.vol); // reduce loudness array to number of bins + + const reducer = (accumulator, currentValue) => accumulator + currentValue; + + let spacing = Math.floor(features.loudness.specific.length / this.bins.length); + this.prevBins = this.bins.slice(0); + this.bins = this.bins.map((bin, index) => { + return features.loudness.specific.slice(index * spacing, (index + 1) * spacing).reduce(reducer); + }).map((bin, index) => { + // map to specified range + // return (bin * (1.0 - this.smooth) + this.prevBins[index] * this.smooth) + return bin * (1.0 - this.settings[index].smooth) + this.prevBins[index] * this.settings[index].smooth; + }); // var y = this.canvas.height - scale*this.settings[index].cutoff + // this.ctx.beginPath() + // this.ctx.moveTo(index*spacing, y) + // this.ctx.lineTo((index+1)*spacing, y) + // this.ctx.stroke() + // + // var yMax = this.canvas.height - scale*(this.settings[index].scale + this.settings[index].cutoff) + + this.fft = this.bins.map((bin, index) => // Math.max(0, (bin - this.cutoff) / (this.max - this.cutoff)) + Math.max(0, (bin - this.settings[index].cutoff) / this.settings[index].scale)); + if (this.isDrawing) this.draw(); + } + } + } + + setCutoff(cutoff) { + this.cutoff = cutoff; + this.settings = this.settings.map(el => { + el.cutoff = cutoff; + return el; + }); + } + + setSmooth(smooth) { + this.smooth = smooth; + this.settings = this.settings.map(el => { + el.smooth = smooth; + return el; + }); + } + + setBins(numBins) { + this.bins = Array(numBins).fill(0); + this.prevBins = Array(numBins).fill(0); + this.fft = Array(numBins).fill(0); + this.settings = Array(numBins).fill(0).map(() => ({ + cutoff: this.cutoff, + scale: this.scale, + smooth: this.smooth + })); // to do: what to do in non-global mode? + + this.bins.forEach((bin, index) => { + window['a' + index] = (scale = 1, offset = 0) => () => a.fft[index] * scale + offset; + }); // console.log(this.settings) + } + + setScale(scale) { + this.scale = scale; + this.settings = this.settings.map(el => { + el.scale = scale; + return el; + }); + } + + setMax(max) { + this.max = max; + console.log('set max is deprecated'); + } + + hide() { + this.isDrawing = false; + this.canvas.style.display = 'none'; + } + + show() { + this.isDrawing = true; + this.canvas.style.display = 'block'; + } + + draw() { + this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); + var spacing = this.canvas.width / this.bins.length; + var scale = this.canvas.height / (this.max * 2); // console.log(this.bins) + + this.bins.forEach((bin, index) => { + var height = bin * scale; + this.ctx.fillRect(index * spacing, this.canvas.height - height, spacing, height); // console.log(this.settings[index]) + + var y = this.canvas.height - scale * this.settings[index].cutoff; + this.ctx.beginPath(); + this.ctx.moveTo(index * spacing, y); + this.ctx.lineTo((index + 1) * spacing, y); + this.ctx.stroke(); + var yMax = this.canvas.height - scale * (this.settings[index].scale + this.settings[index].cutoff); + this.ctx.beginPath(); + this.ctx.moveTo(index * spacing, yMax); + this.ctx.lineTo((index + 1) * spacing, yMax); + this.ctx.stroke(); + }); + /*var y = this.canvas.height - scale*this.cutoff + this.ctx.beginPath() + this.ctx.moveTo(0, y) + this.ctx.lineTo(this.canvas.width, y) + this.ctx.stroke() + var yMax = this.canvas.height - scale*this.max + this.ctx.beginPath() + this.ctx.moveTo(0, yMax) + this.ctx.lineTo(this.canvas.width, yMax) + this.ctx.stroke()*/ + } + +} + +var _default = Audio; +exports.default = _default; + +},{"meyda":3}],22:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +// from https://gist.github.com/gre/1650294 +var _default = { + // no easing, no acceleration + linear: function (t) { + return t; + }, + // accelerating from zero velocity + easeInQuad: function (t) { + return t * t; + }, + // decelerating to zero velocity + easeOutQuad: function (t) { + return t * (2 - t); + }, + // acceleration until halfway, then deceleration + easeInOutQuad: function (t) { + return t < .5 ? 2 * t * t : -1 + (4 - 2 * t) * t; + }, + // accelerating from zero velocity + easeInCubic: function (t) { + return t * t * t; + }, + // decelerating to zero velocity + easeOutCubic: function (t) { + return --t * t * t + 1; + }, + // acceleration until halfway, then deceleration + easeInOutCubic: function (t) { + return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1; + }, + // accelerating from zero velocity + easeInQuart: function (t) { + return t * t * t * t; + }, + // decelerating to zero velocity + easeOutQuart: function (t) { + return 1 - --t * t * t * t; + }, + // acceleration until halfway, then deceleration + easeInOutQuart: function (t) { + return t < .5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t; + }, + // accelerating from zero velocity + easeInQuint: function (t) { + return t * t * t * t * t; + }, + // decelerating to zero velocity + easeOutQuint: function (t) { + return 1 + --t * t * t * t * t; + }, + // acceleration until halfway, then deceleration + easeInOutQuint: function (t) { + return t < .5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t; + }, + // sin shape + sin: function (t) { + return (1 + Math.sin(Math.PI * t - Math.PI / 2)) / 2; + } +}; +exports.default = _default; + +},{}],23:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +// https://github.com/mikolalysenko/mouse-event +const mouse = {}; + +function mouseButtons(ev) { + if (typeof ev === 'object') { + if ('buttons' in ev) { + return ev.buttons; + } else if ('which' in ev) { + var b = ev.which; + + if (b === 2) { + return 4; + } else if (b === 3) { + return 2; + } else if (b > 0) { + return 1 << b - 1; + } + } else if ('button' in ev) { + var b = ev.button; + + if (b === 1) { + return 4; + } else if (b === 2) { + return 2; + } else if (b >= 0) { + return 1 << b; + } + } + } + + return 0; +} + +mouse.buttons = mouseButtons; + +function mouseElement(ev) { + return ev.target || ev.srcElement || window; +} + +mouse.element = mouseElement; + +function mouseRelativeX(ev) { + if (typeof ev === 'object') { + if ('pageX' in ev) { + return ev.pageX; + } + } + + return 0; +} + +mouse.x = mouseRelativeX; + +function mouseRelativeY(ev) { + if (typeof ev === 'object') { + if ('pageY' in ev) { + return ev.pageY; + } + } + + return 0; +} + +mouse.y = mouseRelativeY; +var _default = mouse; +exports.default = _default; + +},{}],24:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _mouseEvent = _interopRequireDefault(require("./mouse-event.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// based on https://github.com/mikolalysenko/mouse-change +var _default = mouseListen; +exports.default = _default; + +function mouseListen(element, callback) { + if (!callback) { + callback = element; + element = window; + } + + var buttonState = 0; + var x = 0; + var y = 0; + var mods = { + shift: false, + alt: false, + control: false, + meta: false + }; + var attached = false; + + function updateMods(ev) { + var changed = false; + + if ('altKey' in ev) { + changed = changed || ev.altKey !== mods.alt; + mods.alt = !!ev.altKey; + } + + if ('shiftKey' in ev) { + changed = changed || ev.shiftKey !== mods.shift; + mods.shift = !!ev.shiftKey; + } + + if ('ctrlKey' in ev) { + changed = changed || ev.ctrlKey !== mods.control; + mods.control = !!ev.ctrlKey; + } + + if ('metaKey' in ev) { + changed = changed || ev.metaKey !== mods.meta; + mods.meta = !!ev.metaKey; + } + + return changed; + } + + function handleEvent(nextButtons, ev) { + var nextX = _mouseEvent.default.x(ev); + + var nextY = _mouseEvent.default.y(ev); + + if ('buttons' in ev) { + nextButtons = ev.buttons | 0; + } + + if (nextButtons !== buttonState || nextX !== x || nextY !== y || updateMods(ev)) { + buttonState = nextButtons | 0; + x = nextX || 0; + y = nextY || 0; + callback && callback(buttonState, x, y, mods); + } + } + + function clearState(ev) { + handleEvent(0, ev); + } + + function handleBlur() { + if (buttonState || x || y || mods.shift || mods.alt || mods.meta || mods.control) { + x = y = 0; + buttonState = 0; + mods.shift = mods.alt = mods.control = mods.meta = false; + callback && callback(0, 0, 0, mods); + } + } + + function handleMods(ev) { + if (updateMods(ev)) { + callback && callback(buttonState, x, y, mods); + } + } + + function handleMouseMove(ev) { + if (_mouseEvent.default.buttons(ev) === 0) { + handleEvent(0, ev); + } else { + handleEvent(buttonState, ev); + } + } + + function handleMouseDown(ev) { + handleEvent(buttonState | _mouseEvent.default.buttons(ev), ev); + } + + function handleMouseUp(ev) { + handleEvent(buttonState & ~_mouseEvent.default.buttons(ev), ev); + } + + function attachListeners() { + if (attached) { + return; + } + + attached = true; + element.addEventListener('mousemove', handleMouseMove); + element.addEventListener('mousedown', handleMouseDown); + element.addEventListener('mouseup', handleMouseUp); + element.addEventListener('mouseleave', clearState); + element.addEventListener('mouseenter', clearState); + element.addEventListener('mouseout', clearState); + element.addEventListener('mouseover', clearState); + element.addEventListener('blur', handleBlur); + element.addEventListener('keyup', handleMods); + element.addEventListener('keydown', handleMods); + element.addEventListener('keypress', handleMods); + + if (element !== window) { + window.addEventListener('blur', handleBlur); + window.addEventListener('keyup', handleMods); + window.addEventListener('keydown', handleMods); + window.addEventListener('keypress', handleMods); + } + } + + function detachListeners() { + if (!attached) { + return; + } + + attached = false; + element.removeEventListener('mousemove', handleMouseMove); + element.removeEventListener('mousedown', handleMouseDown); + element.removeEventListener('mouseup', handleMouseUp); + element.removeEventListener('mouseleave', clearState); + element.removeEventListener('mouseenter', clearState); + element.removeEventListener('mouseout', clearState); + element.removeEventListener('mouseover', clearState); + element.removeEventListener('blur', handleBlur); + element.removeEventListener('keyup', handleMods); + element.removeEventListener('keydown', handleMods); + element.removeEventListener('keypress', handleMods); + + if (element !== window) { + window.removeEventListener('blur', handleBlur); + window.removeEventListener('keyup', handleMods); + window.removeEventListener('keydown', handleMods); + window.removeEventListener('keypress', handleMods); + } + } // Attach listeners + + + attachListeners(); + var result = { + element: element + }; + Object.defineProperties(result, { + enabled: { + get: function () { + return attached; + }, + set: function (f) { + if (f) { + attachListeners(); + } else { + detachListeners(); + } + }, + enumerable: true + }, + buttons: { + get: function () { + return buttonState; + }, + enumerable: true + }, + x: { + get: function () { + return x; + }, + enumerable: true + }, + y: { + get: function () { + return y; + }, + enumerable: true + }, + mods: { + get: function () { + return mods; + }, + enumerable: true + } + }); + return result; +} + +},{"./mouse-event.js":23}],25:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +// attempt custom evaluation sandbox for hydra functions +// for now, just avoids polluting the global namespace +// should probably be replaced with an abstract syntax tree +var _default = parent => { + var initialCode = ``; + var sandbox = createSandbox(initialCode); + + var addToContext = (name, object) => { + initialCode += ` + var ${name} = ${object} + `; + sandbox = createSandbox(initialCode); + }; + + return { + addToContext: addToContext, + eval: code => sandbox.eval(code) + }; + + function createSandbox(initial) { + globalThis.eval(initial); // optional params + + var localEval = function (code) { + globalThis.eval(code); + }; // API/data for end-user + + + return { + eval: localEval + }; + } +}; + +exports.default = _default; + +},{}],26:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _default; + +function _default(options) { + return new Promise(function (resolve, reject) { + // async function startCapture(displayMediaOptions) { + navigator.mediaDevices.getDisplayMedia(options).then(stream => { + const video = document.createElement('video'); + video.srcObject = stream; + video.addEventListener('loadedmetadata', () => { + video.play(); + resolve({ + video: video + }); + }); + }).catch(err => reject(err)); + }); +} + +},{}],27:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +class VideoRecorder { + constructor(stream) { + this.mediaSource = new MediaSource(); + this.stream = stream; // testing using a recording as input + + this.output = document.createElement('video'); + this.output.autoplay = true; + this.output.loop = true; + let self = this; + this.mediaSource.addEventListener('sourceopen', () => { + console.log('MediaSource opened'); + self.sourceBuffer = self.mediaSource.addSourceBuffer('video/webm; codecs="vp8"'); + console.log('Source buffer: ', sourceBuffer); + }); + } + + start() { + // let options = {mimeType: 'video/webm'}; + // let options = {mimeType: 'video/webm;codecs=h264'}; + let options = { + mimeType: 'video/webm;codecs=vp9' + }; + this.recordedBlobs = []; + + try { + this.mediaRecorder = new MediaRecorder(this.stream, options); + } catch (e0) { + console.log('Unable to create MediaRecorder with options Object: ', e0); + + try { + options = { + mimeType: 'video/webm,codecs=vp9' + }; + this.mediaRecorder = new MediaRecorder(this.stream, options); + } catch (e1) { + console.log('Unable to create MediaRecorder with options Object: ', e1); + + try { + options = 'video/vp8'; // Chrome 47 + + this.mediaRecorder = new MediaRecorder(this.stream, options); + } catch (e2) { + alert('MediaRecorder is not supported by this browser.\n\n' + 'Try Firefox 29 or later, or Chrome 47 or later, ' + 'with Enable experimental Web Platform features enabled from chrome://flags.'); + console.error('Exception while creating MediaRecorder:', e2); + return; + } + } + } + + console.log('Created MediaRecorder', this.mediaRecorder, 'with options', options); + this.mediaRecorder.onstop = this._handleStop.bind(this); + this.mediaRecorder.ondataavailable = this._handleDataAvailable.bind(this); + this.mediaRecorder.start(100); // collect 100ms of data + + console.log('MediaRecorder started', this.mediaRecorder); + } + + stop() { + this.mediaRecorder.stop(); + } + + _handleStop() { + //const superBuffer = new Blob(recordedBlobs, {type: 'video/webm'}) + // const blob = new Blob(this.recordedBlobs, {type: 'video/webm;codecs=h264'}) + const blob = new Blob(this.recordedBlobs, { + type: this.mediaRecorder.mimeType + }); + const url = window.URL.createObjectURL(blob); + this.output.src = url; + const a = document.createElement('a'); + a.style.display = 'none'; + a.href = url; + let d = new Date(); + a.download = `hydra-${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}-${d.getHours()}.${d.getMinutes()}.${d.getSeconds()}.webm`; + document.body.appendChild(a); + a.click(); + setTimeout(() => { + document.body.removeChild(a); + window.URL.revokeObjectURL(url); + }, 300); + } + + _handleDataAvailable(event) { + if (event.data && event.data.size > 0) { + this.recordedBlobs.push(event.data); + } + } + +} + +var _default = VideoRecorder; +exports.default = _default; + +},{}],28:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _default; + +//const enumerateDevices = require('enumerate-devices') +function _default(deviceId) { + return navigator.mediaDevices.enumerateDevices().then(devices => devices.filter(devices => devices.kind === 'videoinput')).then(cameras => { + let constraints = { + audio: false, + video: true + }; + + if (cameras[deviceId]) { + constraints['video'] = { + deviceId: { + exact: cameras[deviceId].deviceId + } + }; + } // console.log(cameras) + + + return window.navigator.mediaDevices.getUserMedia(constraints); + }).then(stream => { + const video = document.createElement('video'); + video.setAttribute('autoplay', ''); + video.setAttribute('muted', ''); + video.setAttribute('playsinline', ''); // video.src = window.URL.createObjectURL(stream) + + video.srcObject = stream; + return new Promise((resolve, reject) => { + video.addEventListener('loadedmetadata', () => { + video.play().then(() => resolve({ + video: video + })); + }); + }); + }).catch(console.log.bind(console)); +} + +},{}],29:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +//const transforms = require('./glsl-transforms.js') +var Output = function ({ + regl, + precision, + label = "", + width, + height +}) { + this.regl = regl; + this.precision = precision; + this.label = label; + this.positionBuffer = this.regl.buffer([[-2, 0], [0, -2], [2, 2]]); + + this.draw = () => {}; + + this.init(); + this.pingPongIndex = 0; // for each output, create two fbos for pingponging + + this.fbos = Array(2).fill().map(() => this.regl.framebuffer({ + color: this.regl.texture({ + mag: 'nearest', + width: width, + height: height, + format: 'rgba' + }), + depthStencil: false + })); // array containing render passes + // this.passes = [] +}; + +Output.prototype.resize = function (width, height) { + this.fbos.forEach(fbo => { + fbo.resize(width, height); + }); // console.log(this) +}; + +Output.prototype.getCurrent = function () { + return this.fbos[this.pingPongIndex]; +}; + +Output.prototype.getTexture = function () { + var index = this.pingPongIndex ? 0 : 1; + return this.fbos[index]; +}; + +Output.prototype.init = function () { + // console.log('clearing') + this.transformIndex = 0; + this.fragHeader = ` + precision ${this.precision} float; + + uniform float time; + varying vec2 uv; + `; + this.fragBody = ``; + this.vert = ` + precision ${this.precision} float; + attribute vec2 position; + varying vec2 uv; + + void main () { + uv = position; + gl_Position = vec4(2.0 * position - 1.0, 0, 1); + }`; + this.attributes = { + position: this.positionBuffer + }; + this.uniforms = { + time: this.regl.prop('time'), + resolution: this.regl.prop('resolution') + }; + this.frag = ` + ${this.fragHeader} + + void main () { + vec4 c = vec4(0, 0, 0, 0); + vec2 st = uv; + ${this.fragBody} + gl_FragColor = c; + } + `; + return this; +}; + +Output.prototype.render = function (passes) { + let pass = passes[0]; //console.log('pass', pass, this.pingPongIndex) + + var self = this; + var uniforms = Object.assign(pass.uniforms, { + prevBuffer: () => { + //var index = this.pingPongIndex ? 0 : 1 + // var index = self.pingPong[(passIndex+1)%2] + // console.log('ping pong', self.pingPongIndex) + return self.fbos[self.pingPongIndex]; + } + }); + self.draw = self.regl({ + frag: pass.frag, + vert: self.vert, + attributes: self.attributes, + uniforms: uniforms, + count: 3, + framebuffer: () => { + self.pingPongIndex = self.pingPongIndex ? 0 : 1; + return self.fbos[self.pingPongIndex]; + } + }); +}; + +Output.prototype.tick = function (props) { + // console.log(props) + this.draw(props); +}; + +var _default = Output; +exports.default = _default; + +},{}]},{},[19])(19) +}); diff --git a/StarryNights/img/VUh-6lw0k_files/index-1010dfdc.js b/StarryNights/img/VUh-6lw0k_files/index-1010dfdc.js new file mode 100644 index 0000000..2fd251f --- /dev/null +++ b/StarryNights/img/VUh-6lw0k_files/index-1010dfdc.js @@ -0,0 +1,352 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const f of a.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&n(f)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();var gt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function L_(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){if(this instanceof n){var o=[null];o.push.apply(o,arguments);var a=Function.bind.apply(t,o);return new a}return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),r}var Zc={exports:{}},us=typeof Reflect=="object"?Reflect:null,fd=us&&typeof us.apply=="function"?us.apply:function(t,r,n){return Function.prototype.apply.call(t,r,n)},ml;us&&typeof us.ownKeys=="function"?ml=us.ownKeys:Object.getOwnPropertySymbols?ml=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:ml=function(t){return Object.getOwnPropertyNames(t)};function U_(e){console&&console.warn&&console.warn(e)}var Ky=Number.isNaN||function(t){return t!==t};function yt(){yt.init.call(this)}Zc.exports=yt;Zc.exports.once=O_;yt.EventEmitter=yt;yt.prototype._events=void 0;yt.prototype._eventsCount=0;yt.prototype._maxListeners=void 0;var cd=10;function Wl(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(yt,"defaultMaxListeners",{enumerable:!0,get:function(){return cd},set:function(e){if(typeof e!="number"||e<0||Ky(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");cd=e}});yt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};yt.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Ky(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Vy(e){return e._maxListeners===void 0?yt.defaultMaxListeners:e._maxListeners}yt.prototype.getMaxListeners=function(){return Vy(this)};yt.prototype.emit=function(t){for(var r=[],n=1;n0&&(f=r[0]),f instanceof Error)throw f;var h=new Error("Unhandled error."+(f?" ("+f.message+")":""));throw h.context=f,h}var p=a[t];if(p===void 0)return!1;if(typeof p=="function")fd(p,this,r);else for(var v=p.length,_=Zy(p,v),n=0;n0&&f.length>o&&!f.warned){f.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+f.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=f.length,U_(h)}return e}yt.prototype.addListener=function(t,r){return zy(this,t,r,!1)};yt.prototype.on=yt.prototype.addListener;yt.prototype.prependListener=function(t,r){return zy(this,t,r,!0)};function I_(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Qy(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=I_.bind(n);return o.listener=r,n.wrapFn=o,o}yt.prototype.once=function(t,r){return Wl(r),this.on(t,Qy(this,t,r)),this};yt.prototype.prependOnceListener=function(t,r){return Wl(r),this.prependListener(t,Qy(this,t,r)),this};yt.prototype.removeListener=function(t,r){var n,o,a,f,h;if(Wl(r),o=this._events,o===void 0)return this;if(n=o[t],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete o[t],o.removeListener&&this.emit("removeListener",t,n.listener||r));else if(typeof n!="function"){for(a=-1,f=n.length-1;f>=0;f--)if(n[f]===r||n[f].listener===r){h=n[f].listener,a=f;break}if(a<0)return this;a===0?n.shift():J_(n,a),n.length===1&&(o[t]=n[0]),o.removeListener!==void 0&&this.emit("removeListener",t,h||r)}return this};yt.prototype.off=yt.prototype.removeListener;yt.prototype.removeAllListeners=function(t){var r,n,o;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var a=Object.keys(n),f;for(o=0;o=0;o--)this.removeListener(t,r[o]);return this};function Yy(e,t,r){var n=e._events;if(n===void 0)return[];var o=n[t];return o===void 0?[]:typeof o=="function"?r?[o.listener||o]:[o]:r?N_(o):Zy(o,o.length)}yt.prototype.listeners=function(t){return Yy(this,t,!0)};yt.prototype.rawListeners=function(t){return Yy(this,t,!1)};yt.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Hy.call(e,t)};yt.prototype.listenerCount=Hy;function Hy(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}yt.prototype.eventNames=function(){return this._eventsCount>0?ml(this._events):[]};function Zy(e,t){for(var r=new Array(t),n=0;n0;)r=e.queue.shift(),r(t);e.scheduled=!1,e.queue.length&&e.schedule()})}};No.prototype.setTimeout=function(e){setTimeout(e,0,{timeRemaining:function(){return 1}})};var ea=W_,Xy={exports:{}};/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var hd=Object.getOwnPropertySymbols,K_=Object.prototype.hasOwnProperty,V_=Object.prototype.propertyIsEnumerable;function z_(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function Q_(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(a){return t[a]});if(n.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(a){o[a]=a}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Y_=Q_()?Object.assign:function(e,t){for(var r,n=z_(e),o,a=1;a=we)return Ie;switch(Ie){case"%s":return String(Me[fe++]);case"%d":return Number(Me[fe++]);case"%j":try{return JSON.stringify(Me[fe++])}catch{return"[Circular]"}default:return Ie}}),ke=Me[fe];fe=3&&(fe.depth=arguments[2]),arguments.length>=4&&(fe.colors=arguments[3]),R(X)?fe.showHidden=X:X&&e._extend(fe,X),P(fe.showHidden)&&(fe.showHidden=!1),P(fe.depth)&&(fe.depth=2),P(fe.colors)&&(fe.colors=!1),P(fe.customInspect)&&(fe.customInspect=!0),fe.colors&&(fe.stylize=a),p(fe,K,fe.depth)}e.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function a(K,X){var fe=o.styles[X];return fe?"\x1B["+o.colors[fe][0]+"m"+K+"\x1B["+o.colors[fe][1]+"m":K}function f(K,X){return K}function h(K){var X={};return K.forEach(function(fe,Me){X[fe]=!0}),X}function p(K,X,fe){if(K.customInspect&&X&&A(X.inspect)&&X.inspect!==e.inspect&&!(X.constructor&&X.constructor.prototype===X)){var Me=X.inspect(fe,K);return G(Me)||(Me=p(K,Me,fe)),Me}var we=v(K,X);if(we)return we;var Re=Object.keys(X),ke=h(Re);if(K.showHidden&&(Re=Object.getOwnPropertyNames(X)),ee(X)&&(Re.indexOf("message")>=0||Re.indexOf("description")>=0))return _(X);if(Re.length===0){if(A(X)){var Ie=X.name?": "+X.name:"";return K.stylize("[Function"+Ie+"]","special")}if(F(X))return K.stylize(RegExp.prototype.toString.call(X),"regexp");if(D(X))return K.stylize(Date.prototype.toString.call(X),"date");if(ee(X))return _(X)}var ze="",le=!1,ue=["{","}"];if(U(X)&&(le=!0,ue=["[","]"]),A(X)){var xe=X.name?": "+X.name:"";ze=" [Function"+xe+"]"}if(F(X)&&(ze=" "+RegExp.prototype.toString.call(X)),D(X)&&(ze=" "+Date.prototype.toUTCString.call(X)),ee(X)&&(ze=" "+_(X)),Re.length===0&&(!le||X.length==0))return ue[0]+ze+ue[1];if(fe<0)return F(X)?K.stylize(RegExp.prototype.toString.call(X),"regexp"):K.stylize("[Object]","special");K.seen.push(X);var Le;return le?Le=y(K,X,fe,ke,Re):Le=Re.map(function(De){return m(K,X,fe,ke,De,le)}),K.seen.pop(),x(Le,ze,ue)}function v(K,X){if(P(X))return K.stylize("undefined","undefined");if(G(X)){var fe="'"+JSON.stringify(X).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return K.stylize(fe,"string")}if(L(X))return K.stylize(""+X,"number");if(R(X))return K.stylize(""+X,"boolean");if(S(X))return K.stylize("null","null")}function _(K){return"["+Error.prototype.toString.call(K)+"]"}function y(K,X,fe,Me,we){for(var Re=[],ke=0,Ie=X.length;ke-1&&(Re?Ie=Ie.split(` +`).map(function(le){return" "+le}).join(` +`).substr(2):Ie=` +`+Ie.split(` +`).map(function(le){return" "+le}).join(` +`))):Ie=K.stylize("[Circular]","special")),P(ke)){if(Re&&we.match(/^\d+$/))return Ie;ke=JSON.stringify(""+we),ke.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ke=ke.substr(1,ke.length-2),ke=K.stylize(ke,"name")):(ke=ke.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ke=K.stylize(ke,"string"))}return ke+": "+Ie}function x(K,X,fe){var Me=K.reduce(function(we,Re){return Re.indexOf(` +`)>=0,we+Re.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Me>60?fe[0]+(X===""?"":X+` + `)+" "+K.join(`, + `)+" "+fe[1]:fe[0]+X+" "+K.join(", ")+" "+fe[1]}function U(K){return Array.isArray(K)}e.isArray=U;function R(K){return typeof K=="boolean"}e.isBoolean=R;function S(K){return K===null}e.isNull=S;function g(K){return K==null}e.isNullOrUndefined=g;function L(K){return typeof K=="number"}e.isNumber=L;function G(K){return typeof K=="string"}e.isString=G;function O(K){return typeof K=="symbol"}e.isSymbol=O;function P(K){return K===void 0}e.isUndefined=P;function F(K){return V(K)&&$(K)==="[object RegExp]"}e.isRegExp=F;function V(K){return typeof K=="object"&&K!==null}e.isObject=V;function D(K){return V(K)&&$(K)==="[object Date]"}e.isDate=D;function ee(K){return V(K)&&($(K)==="[object Error]"||K instanceof Error)}e.isError=ee;function A(K){return typeof K=="function"}e.isFunction=A;function q(K){return K===null||typeof K=="boolean"||typeof K=="number"||typeof K=="string"||typeof K=="symbol"||typeof K>"u"}e.isPrimitive=q,e.isBuffer=H_;function $(K){return Object.prototype.toString.call(K)}function ce(K){return K<10?"0"+K.toString(10):K.toString(10)}var ye=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function re(){var K=new Date,X=[ce(K.getHours()),ce(K.getMinutes()),ce(K.getSeconds())].join(":");return[K.getDate(),ye[K.getMonth()],X].join(" ")}e.log=function(){console.log("%s - %s",re(),e.format.apply(e,arguments))},e.inherits=Z_,e._extend=function(K,X){if(!X||!V(X))return K;for(var fe=Object.keys(X),Me=fe.length;Me--;)K[fe[Me]]=X[fe[Me]];return K};function ie(K,X){return Object.prototype.hasOwnProperty.call(K,X)}})(qy);var $_=Y_;/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */function pd(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,o=0,a=Math.min(r,n);o=0){var h=o.indexOf(` +`,f+1);o=o.substring(h+1)}this.stack=o}}};Di.inherits(nt.AssertionError,Error);function md(e,t){return typeof e=="string"?e.length=0;v--)if(f[v]!==h[v])return!1;for(v=f.length-1;v>=0;v--)if(p=f[v],!ps(e[p],t[p],r,n))return!1;return!0}nt.notDeepEqual=function(t,r,n){ps(t,r,!1)&&ai(t,r,n,"notDeepEqual",nt.notDeepEqual)};nt.notDeepStrictEqual=rm;function rm(e,t,r){ps(e,t,!0)&&ai(e,t,r,"notDeepStrictEqual",rm)}nt.strictEqual=function(t,r,n){t!==r&&ai(t,r,n,"===",nt.strictEqual)};nt.notStrictEqual=function(t,r,n){t===r&&ai(t,r,n,"!==",nt.notStrictEqual)};function wd(e,t){if(!e||!t)return!1;if(Object.prototype.toString.call(t)=="[object RegExp]")return t.test(e);try{if(e instanceof t)return!0}catch{}return Error.isPrototypeOf(t)?!1:t.call({},e)===!0}function iw(e){var t;try{e()}catch(r){t=r}return t}function nm(e,t,r,n){var o;if(typeof t!="function")throw new TypeError('"block" argument must be a function');typeof r=="string"&&(n=r,r=null),o=iw(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!o&&ai(o,r,"Missing expected exception"+n);var a=typeof n=="string",f=!e&&Di.isError(o),h=!e&&o&&!r;if((f&&a&&wd(o,r)||h)&&ai(o,r,"Got unwanted exception"+n),e&&o&&r&&!wd(o,r)||!e&&o)throw o}nt.throws=function(e,t,r){nm(!0,e,t,r)};nt.doesNotThrow=function(e,t,r){nm(!1,e,t,r)};nt.ifError=function(e){if(e)throw e};function sm(e,t){e||ai(e,!0,t,"==",sm)}nt.strict=$_(sm,nt,{equal:nt.strictEqual,deepEqual:nt.deepStrictEqual,notEqual:nt.notStrictEqual,notDeepEqual:nt.notDeepStrictEqual});nt.strict.strict=nt.strict;var bd=Object.keys||function(e){var t=[];for(var r in e)X_.call(e,r)&&t.push(r);return t},om=Xy.exports,rw=om,nw={trace:"🔍",debug:"🐛",info:"✨",warn:"⚠️",error:"🚨",fatal:"💀"},am={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},sw={foreground:"#d3c0c8",background:"#2d2d2d",black:"#2d2d2d",red:"#f2777a",green:"#99cc99",yellow:"#ffcc66",blue:"#6699cc",magenta:"#cc99cc",cyan:"#66cccc",white:"#d3d0c8",brightBlack:"#747369"},ow=rr;function rr(e,t){if(t=t||{},!(this instanceof rr))return new rr(e,t);rw.equal(typeof t,"object","nanologger: opts should be type object"),this._name=e||"",this._colors=Object.assign({},sw,t.colors||{});try{this.logLevel=window.localStorage.getItem("logLevel")||"info"}catch{this.logLevel="info"}this._logLevel=am[this.logLevel]}rr.prototype.trace=function(){for(var e=["trace"],t=0,r=arguments.length;t"u"&&(n=um()),lc(e,"",0,[],void 0,0,n);var o;try{_n.length===0?o=JSON.stringify(e,t,r):o=JSON.stringify(e,cm(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;xn.length!==0;){var a=xn.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return o}function fs(e,t,r,n){var o=Object.getOwnPropertyDescriptor(n,r);o.get!==void 0?o.configurable?(Object.defineProperty(n,r,{value:e}),xn.push([n,r,t,o])):_n.push([t,r,e]):(n[r]=e,xn.push([n,r,t]))}function lc(e,t,r,n,o,a,f){a+=1;var h;if(typeof e=="object"&&e!==null){for(h=0;hf.depthLimit){fs(Cl,e,t,o);return}if(typeof f.edgesLimit<"u"&&r+1>f.edgesLimit){fs(Cl,e,t,o);return}if(n.push(e),Array.isArray(e))for(h=0;ht?1:0}function fm(e,t,r,n){typeof n>"u"&&(n=um());var o=uc(e,"",0,[],void 0,0,n)||e,a;try{_n.length===0?a=JSON.stringify(o,t,r):a=JSON.stringify(o,cm(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;xn.length!==0;){var f=xn.pop();f.length===4?Object.defineProperty(f[0],f[1],f[3]):f[0][f[1]]=f[2]}}return a}function uc(e,t,r,n,o,a,f){a+=1;var h;if(typeof e=="object"&&e!==null){for(h=0;hf.depthLimit){fs(Cl,e,t,o);return}if(typeof f.edgesLimit<"u"&&r+1>f.edgesLimit){fs(Cl,e,t,o);return}if(n.push(e),Array.isArray(e))for(h=0;h0)for(var n=0;n<_n.length;n++){var o=_n[n];if(o[1]===t&&o[0]===r){r=o[2],_n.splice(n,1);break}}return e.call(this,t,r)}}var qu={exports:{}},xd;function vw(){return xd||(xd=1,function(e){var t=function(){function r(m,x){return x!=null&&m instanceof x}var n;try{n=Map}catch{n=function(){}}var o;try{o=Set}catch{o=function(){}}var a;try{a=Promise}catch{a=function(){}}function f(m,x,U,R,S){typeof x=="object"&&(U=x.depth,R=x.prototype,S=x.includeNonEnumerable,x=x.circular);var g=[],L=[],G=typeof Buffer<"u";typeof x>"u"&&(x=!0),typeof U>"u"&&(U=1/0);function O(P,F){if(P===null)return null;if(F===0)return P;var V,D;if(typeof P!="object")return P;if(r(P,n))V=new n;else if(r(P,o))V=new o;else if(r(P,a))V=new a(function(K,X){P.then(function(fe){K(O(fe,F-1))},function(fe){X(O(fe,F-1))})});else if(f.__isArray(P))V=[];else if(f.__isRegExp(P))V=new RegExp(P.source,y(P)),P.lastIndex&&(V.lastIndex=P.lastIndex);else if(f.__isDate(P))V=new Date(P.getTime());else{if(G&&Buffer.isBuffer(P))return Buffer.allocUnsafe?V=Buffer.allocUnsafe(P.length):V=new Buffer(P.length),P.copy(V),V;r(P,Error)?V=Object.create(P):typeof R>"u"?(D=Object.getPrototypeOf(P),V=Object.create(D)):(V=Object.create(R),D=R)}if(x){var ee=g.indexOf(P);if(ee!=-1)return L[ee];g.push(P),L.push(V)}r(P,n)&&P.forEach(function(K,X){var fe=O(X,F-1),Me=O(K,F-1);V.set(fe,Me)}),r(P,o)&&P.forEach(function(K){var X=O(K,F-1);V.add(X)});for(var A in P){var q;D&&(q=Object.getOwnPropertyDescriptor(D,A)),!(q&&q.set==null)&&(V[A]=O(P[A],F-1))}if(Object.getOwnPropertySymbols)for(var $=Object.getOwnPropertySymbols(P),A=0;A<$.length;A++){var ce=$[A],ye=Object.getOwnPropertyDescriptor(P,ce);ye&&!ye.enumerable&&!S||(V[ce]=O(P[ce],F-1),ye.enumerable||Object.defineProperty(V,ce,{enumerable:!1}))}if(S)for(var re=Object.getOwnPropertyNames(P),A=0;A"u")throw new Error("document-ready only runs in the browser");var t=document.readyState;if(t==="complete"||t==="interactive")return setTimeout(e,0);document.addEventListener("DOMContentLoaded",function(){e()})}var hm=ea(),Mw=di,Or;Vl.disabled=!0;try{Or=window.performance,Vl.disabled=window.localStorage.DISABLE_NANOTIMING==="true"||!Or.mark}catch{}var $c=Vl;function Vl(e){if(Mw.equal(typeof e,"string","nanotiming: name should be type string"),Vl.disabled)return Cw;var t=(Or.now()*1e4).toFixed()%Number.MAX_SAFE_INTEGER,r="start-"+t+"-"+e;Or.mark(r);function n(o){var a="end-"+t+"-"+e;Or.mark(a),hm.push(function(){var f=null;try{var h=e+" ["+t+"]";Or.measure(h,r,a),Or.clearMarks(r),Or.clearMarks(a)}catch(p){f=p}o&&o(f,e)})}return n.uuid=t,n}function Cw(e){e&&hm.push(function(){e(new Error("nanotiming: performance API unavailable"))})}var Tl=di,Tw=ds;function ds(){if(!(this instanceof ds))return new ds;this.trie={nodes:{}}}ds.prototype.create=function(e){Tl.equal(typeof e,"string","route should be a string");var t=e.replace(/^\//,"").split("/");function r(n,o){var a=vl(t,n)&&t[n];if(a===!1)return o;var f=null;return/^:|^\*/.test(a)?(vl(o.nodes,"$$")?f=o.nodes.$$:(f={nodes:{}},o.nodes.$$=f),a[0]==="*"&&(o.wildcard=!0),o.name=a.replace(/^:|^\*/,"")):vl(o.nodes,a)?f=o.nodes[a]:(f={nodes:{}},o.nodes[a]=f),r(n+1,f)}return r(0,this.trie)};ds.prototype.match=function(e){Tl.equal(typeof e,"string","route should be a string");var t=e.replace(/^\//,"").split("/"),r={};function n(a,f){if(f!==void 0){var h=t[a];if(h===void 0)return f;if(vl(f.nodes,h))return n(a+1,f.nodes[h]);if(f.name){try{r[f.name]=decodeURIComponent(h)}catch{return n(a,void 0)}return n(a+1,f.nodes.$$)}else if(f.wildcard){try{r.wildcard=decodeURIComponent(t.slice(a).join("/"))}catch{return n(a,void 0)}return f.nodes.$$}else return n(a+1)}}var o=n(0,this.trie);if(o)return o=Object.assign({},o),o.params=r,o};ds.prototype.mount=function(e,t){Tl.equal(typeof e,"string","route should be a string"),Tl.equal(typeof t,"object","trie should be a object");var r=e.replace(/^\//,"").split("/"),n=null,o=null;if(r.length===1)o=r[0],n=this.create(o);else{var a=r.join("/");o=r[0],n=this.create(a)}Object.assign(n.nodes,t.nodes),t.name&&(n.name=t.name),n.nodes[""]&&(Object.keys(n.nodes[""]).forEach(function(f){f!=="nodes"&&(n[f]=n.nodes[""][f])}),Object.assign(n.nodes,n.nodes[""].nodes),delete n.nodes[""].nodes)};function vl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var ef=di,Ew=Tw,kw=fc;function fc(e){if(!(this instanceof fc))return new fc(e);var t=(e||"").replace(/^\//,""),r=Ew();return o._trie=r,o.on=n,o.emit=o,o.match=a,o._wayfarer=!0,o;function n(h,p){if(ef.equal(typeof h,"string"),ef.equal(typeof p,"function"),h=h||"/",p._wayfarer&&p._trie)r.mount(h,p._trie.trie);else{var v=r.create(h);v.cb=p,v.route=h}return o}function o(h){var p=a(h),v=new Array(arguments.length);v[0]=p.params;for(var _=1;_=0;--v)p=n[v],h=p.name,o=p.namespaceURI,a=p.value,o?(h=p.localName||h,f=t.getAttributeNS(o,h),f!==a&&t.setAttributeNS(o,h,a)):t.hasAttribute(h)?(f=t.getAttribute(h),f!==a&&(a==="null"||a==="undefined"?t.removeAttribute(h):t.setAttribute(h,a))):t.setAttribute(h,a);for(var _=r.length-1;_>=0;--_)p=r[_],p.specified!==!1&&(h=p.name,o=p.namespaceURI,o?(h=p.localName||h,e.hasAttributeNS(o,h)||t.removeAttributeNS(o,h)):e.hasAttributeNS(null,h)||t.removeAttribute(h))}function Qw(e,t){for(var r=0;r"u","nanoraf: raf should be a function or undefined"),t||(t=window.requestAnimationFrame);var r=!1,n=null;return function(){n===null&&!r&&(r=!0,t(function(){r=!1;for(var f=n.length,h=new Array(f),p=0;p=a||n===0)){n=r+n>a?a-r:n;var f=a-n;for(o=r;o0&&this._emit(this._listeners[e],t),this._starListeners.length>0&&this._emit(this._starListeners,e,t,o.uuid),o(),this};pi.prototype.on=pi.prototype.addListener=function(e,t){return Pi.ok(typeof e=="string"||typeof e=="symbol","nanobus.on: eventName should be type string or symbol"),Pi.equal(typeof t,"function","nanobus.on: listener should be type function"),e==="*"?this._starListeners.push(t):(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)),this};pi.prototype.prependListener=function(e,t){return Pi.ok(typeof e=="string"||typeof e=="symbol","nanobus.prependListener: eventName should be type string or symbol"),Pi.equal(typeof t,"function","nanobus.prependListener: listener should be type function"),e==="*"?this._starListeners.unshift(t):(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].unshift(t)),this};pi.prototype.once=function(e,t){Pi.ok(typeof e=="string"||typeof e=="symbol","nanobus.once: eventName should be type string or symbol"),Pi.equal(typeof t,"function","nanobus.once: listener should be type function");var r=this;this.on(e,n);function n(){t.apply(r,arguments),r.removeListener(e,n)}return this};pi.prototype.prependOnceListener=function(e,t){Pi.ok(typeof e=="string"||typeof e=="symbol","nanobus.prependOnceListener: eventName should be type string or symbol"),Pi.equal(typeof t,"function","nanobus.prependOnceListener: listener should be type function");var r=this;this.prependListener(e,n);function n(){t.apply(r,arguments),r.removeListener(e,n)}return this};pi.prototype.removeListener=function(e,t){if(Pi.ok(typeof e=="string"||typeof e=="symbol","nanobus.removeListener: eventName should be type string or symbol"),Pi.equal(typeof t,"function","nanobus.removeListener: listener should be type function"),e==="*")return this._starListeners=this._starListeners.slice(),r(this._starListeners,t);return typeof this._listeners[e]<"u"&&(this._listeners[e]=this._listeners[e].slice()),r(this._listeners[e],t);function r(n,o){if(n){var a=n.indexOf(o);if(a!==-1)return c1(n,a,1),!0}}};pi.prototype.removeAllListeners=function(e){return e?e==="*"?this._starListeners=[]:this._listeners[e]=[]:(this._starListeners=[],this._listeners={}),this};pi.prototype.listeners=function(e){var t=e!=="*"?this._listeners[e]:this._starListeners,r=[];if(t)for(var n=t.length,o=0;o"u")&&e.length!==0){r===void 0&&(r=t,t=null),t&&(n!==void 0?r=[t].concat(r,n):r=[t].concat(r));for(var o=e.length,a=0;athis.maxAge?(this.remove(e),!1):!0};xi.prototype.get=function(e){if(typeof e!="string"&&(e=""+e),!!this.cache.hasOwnProperty(e)){var t=this.cache[e];if(this._checkAge(e,t))return this.head!==e&&(e===this.tail?(this.tail=t.next,this.cache[this.tail].prev=null):this.cache[t.prev].next=t.next,this.cache[t.next].prev=t.prev,this.cache[this.head].next=e,t.prev=this.head,t.next=null,this.head=e),t.value}};xi.prototype.evict=function(){this.tail&&this.remove(this.tail)};var Ro=di,Td=d1,g1=qc;function qc(e,t,r){Ro.ok(this instanceof qc,"ChooComponentCache should be created with `new`"),Ro.equal(typeof e,"object","ChooComponentCache: state should be type object"),Ro.equal(typeof t,"function","ChooComponentCache: emit should be type function"),typeof r=="number"?this.cache=new Td(r):this.cache=r||new Td(100),this.state=e,this.emit=t}qc.prototype.render=function(e,t){Ro.equal(typeof e,"function","ChooComponentCache.render: Component should be type function"),Ro.ok(typeof t=="string"||typeof t=="number","ChooComponentCache.render: id should be type string or type number");var r=this.cache.get(t);if(!r){for(var n=[],o=2,a=arguments.length;o is not the same type as the new node <"+n.nodeName.toLowerCase()+">.");var o=tr("choo.morph");wm(t._tree,n),o(),r()})),_m(function(){t.emitter.emit(t._events.DOMCONTENTLOADED),t._loaded=!0}),e(),this._tree};Gi.prototype.mount=function(t){var r=tr("choo.mount('"+t+"')");if(typeof window!="object")return kt.ok(typeof t=="string","choo.mount: selector should be type String"),this.selector=t,r(),this;kt.ok(typeof t=="string"||typeof t=="object","choo.mount: selector should be type String or HTMLElement");var n=this;_m(function(){var o=tr("choo.render"),a=n.start();typeof t=="string"?n._tree=document.querySelector(t):n._tree=t,kt.ok(n._tree,"choo.mount: could not query selector: "+t),kt.equal(n._tree.nodeName,a.nodeName,"choo.mount: The target node <"+n._tree.nodeName.toLowerCase()+"> is not the same type as the new node <"+a.nodeName.toLowerCase()+">.");var f=tr("choo.morph");wm(n._tree,a),f(),o()}),r()};Gi.prototype.toString=function(e,t){t=t||{},t.components=t.components||{},t.events=Object.assign({},t.events,this._events),kt.notEqual(typeof window,"object","choo.mount: window was found. .toString() must be called in Node, use .start() or .mount() if running in the browser"),kt.equal(typeof e,"string","choo.toString: location should be type string"),kt.equal(typeof t,"object","choo.toString: state should be type object"),this._setCache(t),this._matchRoute(t,e),this.emitter.removeAllListeners(),this._stores.forEach(function(n){n(t)});var r=this._prerender(t);return kt.ok(r,"choo.toString: no valid value returned for the route "+e),kt(!Array.isArray(r),"choo.toString: return value was an array for the route "+e),typeof r.outerHTML=="string"?r.outerHTML:r.toString()};Gi.prototype._matchRoute=function(e,t){var r,n;t?(r=t.replace(/\?.+$/,"").replace(/\/$/,""),this._hashEnabled||(r=r.replace(/#.+$/,"")),n=t):(r=window.location.pathname.replace(/\/$/,""),this._hashEnabled&&(r+=window.location.hash.replace(/^#/,"/")),n=window.location.search);var o=this.router.match(r);this._handler=o.cb,e.href=r,e.query=m1(n),e.route=o.route,e.params=o.params};Gi.prototype._prerender=function(e){var t=tr("choo.prerender('"+e.route+"')"),r=this._handler(e,this.emit);return t(),r};Gi.prototype._setCache=function(e){var t=new b1(e,this.emitter.emit.bind(this.emitter),this._cache);e.cache=r;function r(n,o){kt.equal(typeof n,"function","choo.state.cache: Component should be type function");for(var a=[],f=0,h=arguments.length;f{})=>{const r={isError:!1,codeString:"",errorMessage:""};var n=`(async() => { + ${e} +})().catch(${o=>{window._reportError(o)}})`;try{window.eval(n)}catch(o){r.errorMessage=o.message}r.codeString=n,r.errorMessage.length>0&&(r.isError=!0),t(r)}};function C1(e,t){e.showInfo=!1,e.showUI=!0,e.showExtensions=!1,e.errorMessage="",e.isError=!1;const r="https://api.hydrasynth.xyz";e.serverURL=r,window._reportError=o=>{e.errorMessage=o.message,e.isError=!0,t.emit("render")},t.on("load and eval code",(o,a=!0)=>{t.emit("editor: load code",o),t.emit("repl: eval",o),a&&t.emit("gallery: save to URL",o)}),t.on("repl: eval",(o="",a)=>{M1.eval(o,f=>{e.errorMessage=f.errorMessage,e.isError=f.isError,a&&a(f.codeString,f.isError),t.emit("render")})}),t.on("screencap",()=>{screencap();const a=e.editor.editor.getValue(),f=new Blob([a],{type:"text/plain"}),h=document.createElement("a");h.style.display="none";let p=new Date;h.download=`hydra-${p.getFullYear()}-${p.getMonth()+1}-${p.getDate()}-${p.getHours()}.${p.getMinutes()}.${p.getSeconds()}.js`,h.href=URL.createObjectURL(f),h.click(),setTimeout(()=>{window.URL.revokeObjectURL(h.href)},300)});function n(){const o=e.editor.editor;hush(),speed=1,t.emit("gallery: clear"),o.clear()}t.on("clear all",()=>{n()}),t.on("ui: hide all",function(){e.showUI=!e.showUI,t.emit("render")}),t.on("ui: toggle info",function(o){e.showInfo?t.emit("ui: hide info"):t.emit("ui: show info")}),t.on("ui: show info",()=>{e.showInfo=!0,t.emit("render")}),t.on("ui: hide info",()=>{e.showInfo=!1,e.showExtensions=!1,t.emit("render")}),t.on("ui: show extensions",()=>{e.showExtensions=!0,e.showInfo=!0,t.emit("extensions: select category"),t.emit("render")}),t.on("ui: hide extensions",()=>{e.showExtensions=!1,t.emit("render")})}function ji(e){"@babel/helpers - typeof";return ji=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ji(e)}function Wi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T1(e,t){if(ji(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ji(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bm(e){var t=T1(e,"string");return ji(t)==="symbol"?t:String(t)}function Rd(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:{};Wi(this,e),this.init(t,r)}return Ki(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=r||U1,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function(r){this.debug=r}},{key:"log",value:function(){for(var r=arguments.length,n=new Array(r),o=0;o1?n-1:0),a=1;a-1?h.replace(/###/g,"."):h}function o(){return!e||typeof e=="string"}for(var a=typeof t!="string"?[].concat(t):t.split(".");a.length>1;){if(o())return{};var f=n(a.shift());!e[f]&&r&&(e[f]=new r),Object.prototype.hasOwnProperty.call(e,f)?e=e[f]:e={}}return o()?{}:{obj:e,k:n(a.shift())}}function Nd(e,t,r){var n=eh(e,t,Object),o=n.obj,a=n.k;o[a]=r}function N1(e,t,r,n){var o=eh(e,t,Object),a=o.obj,f=o.k;a[f]=a[f]||[],n&&(a[f]=a[f].concat(r)),n||a[f].push(r)}function El(e,t){var r=eh(e,t),n=r.obj,o=r.k;if(n)return n[o]}function Od(e,t,r){var n=El(e,r);return n!==void 0?n:El(t,r)}function xm(e,t,r){for(var n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?r&&(e[n]=t[n]):xm(e[n],t[n],r):e[n]=t[n]);return e}function Zn(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var O1={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function B1(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return O1[t]}):e}var Ql=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,F1=[" ",",","?","!",";"];function D1(e,t,r){t=t||"",r=r||"";var n=F1.filter(function(h){return t.indexOf(h)<0&&r.indexOf(h)<0});if(n.length===0)return!0;var o=new RegExp("(".concat(n.map(function(h){return h==="?"?"\\?":h}).join("|"),")")),a=!o.test(e);if(!a){var f=e.indexOf(r);f>0&&!o.test(e.substring(0,f))&&(a=!0)}return a}function Bd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function za(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sm(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var n=t.split(r),o=e,a=0;aa+f;)f++,h=n.slice(a,a+f).join(r),p=o[h];if(p===void 0)return;if(p===null)return null;if(t.endsWith(h)){if(typeof p=="string")return p;if(h&&typeof p[h]=="string")return p[h]}var v=n.slice(a+f).join(r);return v?Sm(p,v,r):void 0}o=o[n[a]]}return o}}var G1=function(e){zl(r,e);var t=j1(r);function r(n){var o,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Wi(this,r),o=t.call(this),Ql&&zr.call(Vr(o)),o.data=n||{},o.options=a,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.options.ignoreJSONStructure===void 0&&(o.options.ignoreJSONStructure=!0),o}return Ki(r,[{key:"addNamespaces",value:function(o){this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}},{key:"removeNamespaces",value:function(o){var a=this.options.ns.indexOf(o);a>-1&&this.options.ns.splice(a,1)}},{key:"getResource",value:function(o,a,f){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},p=h.keySeparator!==void 0?h.keySeparator:this.options.keySeparator,v=h.ignoreJSONStructure!==void 0?h.ignoreJSONStructure:this.options.ignoreJSONStructure,_=[o,a];f&&typeof f!="string"&&(_=_.concat(f)),f&&typeof f=="string"&&(_=_.concat(p?f.split(p):f)),o.indexOf(".")>-1&&(_=o.split("."));var y=El(this.data,_);return y||!v||typeof f!="string"?y:Sm(this.data&&this.data[o]&&this.data[o][a],f,p)}},{key:"addResource",value:function(o,a,f,h){var p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},v=this.options.keySeparator;v===void 0&&(v=".");var _=[o,a];f&&(_=_.concat(v?f.split(v):f)),o.indexOf(".")>-1&&(_=o.split("."),h=a,a=_[1]),this.addNamespaces(a),Nd(this.data,_,h),p.silent||this.emit("added",o,a,f,h)}},{key:"addResources",value:function(o,a,f){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var p in f)(typeof f[p]=="string"||Object.prototype.toString.apply(f[p])==="[object Array]")&&this.addResource(o,a,p,f[p],{silent:!0});h.silent||this.emit("added",o,a,f)}},{key:"addResourceBundle",value:function(o,a,f,h,p){var v=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},_=[o,a];o.indexOf(".")>-1&&(_=o.split("."),h=f,f=a,a=_[1]),this.addNamespaces(a);var y=El(this.data,_)||{};h?xm(y,f,p):y=za(za({},y),f),Nd(this.data,_,y),v.silent||this.emit("added",o,a,f)}},{key:"removeResourceBundle",value:function(o,a){this.hasResourceBundle(o,a)&&delete this.data[o][a],this.removeNamespaces(a),this.emit("removed",o,a)}},{key:"hasResourceBundle",value:function(o,a){return this.getResource(o,a)!==void 0}},{key:"getResourceBundle",value:function(o,a){return a||(a=this.options.defaultNS),this.options.compatibilityAPI==="v1"?za(za({},{}),this.getResource(o,a)):this.getResource(o,a)}},{key:"getDataByLanguage",value:function(o){return this.data[o]}},{key:"hasLanguageSomeTranslations",value:function(o){var a=this.getDataByLanguage(o),f=a&&Object.keys(a)||[];return!!f.find(function(h){return a[h]&&Object.keys(a[h]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),r}(zr),Mm={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,r,n,o,a){var f=this;return t.forEach(function(h){f.processors[h]&&(r=f.processors[h].process(r,n,o,a))}),r}};function Fd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function qt(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Dd={},jd=function(e){zl(r,e);var t=W1(r);function r(n){var o,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Wi(this,r),o=t.call(this),Ql&&zr.call(Vr(o)),J1(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,Vr(o)),o.options=a,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.logger=er.create("translator"),o}return Ki(r,[{key:"changeLanguage",value:function(o){o&&(this.language=o)}},{key:"exists",value:function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(o==null)return!1;var f=this.resolve(o,a);return f&&f.res!==void 0}},{key:"extractFromKey",value:function(o,a){var f=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");var h=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,p=a.ns||this.options.defaultNS||[],v=f&&o.indexOf(f)>-1,_=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!D1(o,f,h);if(v&&!_){var y=o.match(this.interpolator.nestingRegexp);if(y&&y.length>0)return{key:o,namespaces:p};var m=o.split(f);(f!==h||f===h&&this.options.ns.indexOf(m[0])>-1)&&(p=m.shift()),o=m.join(h)}return typeof p=="string"&&(p=[p]),{key:o,namespaces:p}}},{key:"translate",value:function(o,a,f){var h=this;if(ji(a)!=="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),a||(a={}),o==null)return"";Array.isArray(o)||(o=[String(o)]);var p=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,v=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,_=this.extractFromKey(o[o.length-1],a),y=_.key,m=_.namespaces,x=m[m.length-1],U=a.lng||this.language,R=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(U&&U.toLowerCase()==="cimode"){if(R){var S=a.nsSeparator||this.options.nsSeparator;return p?(g.res="".concat(x).concat(S).concat(y),g):"".concat(x).concat(S).concat(y)}return p?(g.res=y,g):y}var g=this.resolve(o,a),L=g&&g.res,G=g&&g.usedKey||y,O=g&&g.exactUsedKey||y,P=Object.prototype.toString.apply(L),F=["[object Number]","[object Function]","[object RegExp]"],V=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,ee=typeof L!="string"&&typeof L!="boolean"&&typeof L!="number";if(D&&L&&ee&&F.indexOf(P)<0&&!(typeof V=="string"&&P==="[object Array]")){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var A=this.options.returnedObjectHandler?this.options.returnedObjectHandler(G,L,qt(qt({},a),{},{ns:m})):"key '".concat(y," (").concat(this.language,")' returned an object instead of string.");return p?(g.res=A,g):A}if(v){var q=P==="[object Array]",$=q?[]:{},ce=q?O:G;for(var ye in L)if(Object.prototype.hasOwnProperty.call(L,ye)){var re="".concat(ce).concat(v).concat(ye);$[ye]=this.translate(re,qt(qt({},a),{joinArrays:!1,ns:m})),$[ye]===re&&($[ye]=L[ye])}L=$}}else if(D&&typeof V=="string"&&P==="[object Array]")L=L.join(V),L&&(L=this.extendTranslation(L,o,a,f));else{var ie=!1,K=!1,X=a.count!==void 0&&typeof a.count!="string",fe=r.hasDefaultValue(a),Me=X?this.pluralResolver.getSuffix(U,a.count,a):"",we=a["defaultValue".concat(Me)]||a.defaultValue;!this.isValidLookup(L)&&fe&&(ie=!0,L=we),this.isValidLookup(L)||(K=!0,L=y);var Re=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,ke=Re&&K?void 0:L,Ie=fe&&we!==L&&this.options.updateMissing;if(K||ie||Ie){if(this.logger.log(Ie?"updateKey":"missingKey",U,x,y,Ie?we:L),v){var ze=this.resolve(y,qt(qt({},a),{},{keySeparator:!1}));ze&&ze.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var le=[],ue=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ue&&ue[0])for(var xe=0;xe1&&arguments[1]!==void 0?arguments[1]:{},h,p,v,_,y;return typeof o=="string"&&(o=[o]),o.forEach(function(m){if(!a.isValidLookup(h)){var x=a.extractFromKey(m,f),U=x.key;p=U;var R=x.namespaces;a.options.fallbackNS&&(R=R.concat(a.options.fallbackNS));var S=f.count!==void 0&&typeof f.count!="string",g=S&&!f.ordinal&&f.count===0&&a.pluralResolver.shouldUseIntlApi(),L=f.context!==void 0&&(typeof f.context=="string"||typeof f.context=="number")&&f.context!=="",G=f.lngs?f.lngs:a.languageUtils.toResolveHierarchy(f.lng||a.language,f.fallbackLng);R.forEach(function(O){a.isValidLookup(h)||(y=O,!Dd["".concat(G[0],"-").concat(O)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(y)&&(Dd["".concat(G[0],"-").concat(O)]=!0,a.logger.warn('key "'.concat(p,'" for languages "').concat(G.join(", "),`" won't get resolved as namespace "`).concat(y,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),G.forEach(function(P){if(!a.isValidLookup(h)){_=P;var F=[U];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(F,U,P,O,f);else{var V;S&&(V=a.pluralResolver.getSuffix(P,f.count,f));var D="".concat(a.options.pluralSeparator,"zero");if(S&&(F.push(U+V),g&&F.push(U+D)),L){var ee="".concat(U).concat(a.options.contextSeparator).concat(f.context);F.push(ee),S&&(F.push(ee+V),g&&F.push(ee+D))}}for(var A;A=F.pop();)a.isValidLookup(h)||(v=A,h=a.getResource(P,O,A,f))}}))})}}),{res:h,usedKey:p,exactUsedKey:v,usedLng:_,usedNS:y}}},{key:"isValidLookup",value:function(o){return o!==void 0&&!(!this.options.returnNull&&o===null)&&!(!this.options.returnEmptyString&&o==="")}},{key:"getResource",value:function(o,a,f){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(o,a,f,h):this.resourceStore.getResource(o,a,f,h)}}],[{key:"hasDefaultValue",value:function(o){var a="defaultValue";for(var f in o)if(Object.prototype.hasOwnProperty.call(o,f)&&a===f.substring(0,a.length)&&o[f]!==void 0)return!0;return!1}}]),r}(zr);function nf(e){return e.charAt(0).toUpperCase()+e.slice(1)}var V1=function(){function e(t){Wi(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=er.create("languageUtils")}return Ki(e,[{key:"getScriptPartFromCode",value:function(r){if(!r||r.indexOf("-")<0)return null;var n=r.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}},{key:"getLanguagePartFromCode",value:function(r){if(!r||r.indexOf("-")<0)return r;var n=r.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function(r){if(typeof r=="string"&&r.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],o=r.split("-");return this.options.lowerCaseLng?o=o.map(function(a){return a.toLowerCase()}):o.length===2?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),n.indexOf(o[1].toLowerCase())>-1&&(o[1]=nf(o[1].toLowerCase()))):o.length===3&&(o[0]=o[0].toLowerCase(),o[1].length===2&&(o[1]=o[1].toUpperCase()),o[0]!=="sgn"&&o[2].length===2&&(o[2]=o[2].toUpperCase()),n.indexOf(o[1].toLowerCase())>-1&&(o[1]=nf(o[1].toLowerCase())),n.indexOf(o[2].toLowerCase())>-1&&(o[2]=nf(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?r.toLowerCase():r}},{key:"isSupportedCode",value:function(r){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(r=this.getLanguagePartFromCode(r)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(r)>-1}},{key:"getBestMatchFromCodes",value:function(r){var n=this;if(!r)return null;var o;return r.forEach(function(a){if(!o){var f=n.formatLanguageCode(a);(!n.options.supportedLngs||n.isSupportedCode(f))&&(o=f)}}),!o&&this.options.supportedLngs&&r.forEach(function(a){if(!o){var f=n.getLanguagePartFromCode(a);if(n.isSupportedCode(f))return o=f;o=n.options.supportedLngs.find(function(h){if(h.indexOf(f)===0)return h})}}),o||(o=this.getFallbackCodes(this.options.fallbackLng)[0]),o}},{key:"getFallbackCodes",value:function(r,n){if(!r)return[];if(typeof r=="function"&&(r=r(n)),typeof r=="string"&&(r=[r]),Object.prototype.toString.apply(r)==="[object Array]")return r;if(!n)return r.default||[];var o=r[n];return o||(o=r[this.getScriptPartFromCode(n)]),o||(o=r[this.formatLanguageCode(n)]),o||(o=r[this.getLanguagePartFromCode(n)]),o||(o=r.default),o||[]}},{key:"toResolveHierarchy",value:function(r,n){var o=this,a=this.getFallbackCodes(n||this.options.fallbackLng||[],r),f=[],h=function(v){v&&(o.isSupportedCode(v)?f.push(v):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(v)))};return typeof r=="string"&&r.indexOf("-")>-1?(this.options.load!=="languageOnly"&&h(this.formatLanguageCode(r)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&h(this.getScriptPartFromCode(r)),this.options.load!=="currentOnly"&&h(this.getLanguagePartFromCode(r))):typeof r=="string"&&h(this.formatLanguageCode(r)),a.forEach(function(p){f.indexOf(p)<0&&h(o.formatLanguageCode(p))}),f}}]),e}(),z1=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Q1={1:function(t){return+(t>1)},2:function(t){return+(t!=1)},3:function(t){return 0},4:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},5:function(t){return t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},6:function(t){return t==1?0:t>=2&&t<=4?1:2},7:function(t){return t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},8:function(t){return t==1?0:t==2?1:t!=8&&t!=11?2:3},9:function(t){return+(t>=2)},10:function(t){return t==1?0:t==2?1:t<7?2:t<11?3:4},11:function(t){return t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3},12:function(t){return+(t%10!=1||t%100==11)},13:function(t){return+(t!==0)},14:function(t){return t==1?0:t==2?1:t==3?2:3},15:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2},16:function(t){return t%10==1&&t%100!=11?0:t!==0?1:2},17:function(t){return t==1||t%10==1&&t%100!=11?0:1},18:function(t){return t==0?0:t==1?1:2},19:function(t){return t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3},20:function(t){return t==1?0:t==0||t%100>0&&t%100<20?1:2},21:function(t){return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0},22:function(t){return t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3}},Y1=["v1","v2","v3"],Pd={zero:0,one:1,two:2,few:3,many:4,other:5};function H1(){var e={};return z1.forEach(function(t){t.lngs.forEach(function(r){e[r]={numbers:t.nr,plurals:Q1[t.fc]}})}),e}var Z1=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Wi(this,e),this.languageUtils=t,this.options=r,this.logger=er.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=H1()}return Ki(e,[{key:"addRule",value:function(r,n){this.rules[r]=n}},{key:"getRule",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(r,{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[r]||this.rules[this.languageUtils.getLanguagePartFromCode(r)]}},{key:"needsPlural",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(r,n);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(r,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(r,o).map(function(a){return"".concat(n).concat(a)})}},{key:"getSuffixes",value:function(r){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this.getRule(r,o);return a?this.shouldUseIntlApi()?a.resolvedOptions().pluralCategories.sort(function(f,h){return Pd[f]-Pd[h]}).map(function(f){return"".concat(n.options.prepend).concat(f)}):a.numbers.map(function(f){return n.getSuffix(r,f,o)}):[]}},{key:"getSuffix",value:function(r,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=this.getRule(r,o);return a?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(a.select(n)):this.getSuffixRetroCompatible(a,n):(this.logger.warn("no plural rule found for: ".concat(r)),"")}},{key:"getSuffixRetroCompatible",value:function(r,n){var o=this,a=r.noAbs?r.plurals(n):r.plurals(Math.abs(n)),f=r.numbers[a];this.options.simplifyPluralSuffix&&r.numbers.length===2&&r.numbers[0]===1&&(f===2?f="plural":f===1&&(f=""));var h=function(){return o.options.prepend&&f.toString()?o.options.prepend+f.toString():f.toString()};return this.options.compatibilityJSON==="v1"?f===1?"":typeof f=="number"?"_plural_".concat(f.toString()):h():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&r.numbers.length===2&&r.numbers[0]===1?h():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}},{key:"shouldUseIntlApi",value:function(){return!Y1.includes(this.options.compatibilityJSON)}}]),e}();function Gd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ii(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};Wi(this,e),this.logger=er.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(r){return r},this.init(t)}return Ki(e,[{key:"init",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r.interpolation||(r.interpolation={escapeValue:!0});var n=r.interpolation;this.escape=n.escape!==void 0?n.escape:B1,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?Zn(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?Zn(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?Zn(n.nestingPrefix):n.nestingPrefixEscaped||Zn("$t("),this.nestingSuffix=n.nestingSuffix?Zn(n.nestingSuffix):n.nestingSuffixEscaped||Zn(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var r="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(r,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(n,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function(r,n,o,a){var f=this,h,p,v,_=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function y(S){return S.replace(/\$/g,"$$$$")}var m=function(g){if(g.indexOf(f.formatSeparator)<0){var L=Od(n,_,g);return f.alwaysFormat?f.format(L,void 0,o,Ii(Ii(Ii({},a),n),{},{interpolationkey:g})):L}var G=g.split(f.formatSeparator),O=G.shift().trim(),P=G.join(f.formatSeparator).trim();return f.format(Od(n,_,O),P,o,Ii(Ii(Ii({},a),n),{},{interpolationkey:O}))};this.resetRegExp();var x=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,U=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,R=[{regex:this.regexpUnescape,safeValue:function(g){return y(g)}},{regex:this.regexp,safeValue:function(g){return f.escapeValue?y(f.escape(g)):y(g)}}];return R.forEach(function(S){for(v=0;h=S.regex.exec(r);){var g=h[1].trim();if(p=m(g),p===void 0)if(typeof x=="function"){var L=x(r,h,a);p=typeof L=="string"?L:""}else if(a&&a.hasOwnProperty(g))p="";else if(U){p=h[0];continue}else f.logger.warn("missed to pass in variable ".concat(g," for interpolating ").concat(r)),p="";else typeof p!="string"&&!f.useRawValueToEscape&&(p=Jd(p));var G=S.safeValue(p);if(r=r.replace(h[0],G),U?(S.regex.lastIndex+=p.length,S.regex.lastIndex-=h[0].length):S.regex.lastIndex=0,v++,v>=f.maxReplaces)break}}),r}},{key:"nest",value:function(r,n){var o=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},f,h,p=Ii({},a);p.applyPostProcessor=!1,delete p.defaultValue;function v(x,U){var R=this.nestingOptionsSeparator;if(x.indexOf(R)<0)return x;var S=x.split(new RegExp("".concat(R,"[ ]*{"))),g="{".concat(S[1]);x=S[0],g=this.interpolate(g,p);var L=g.match(/'/g),G=g.match(/"/g);(L&&L.length%2===0&&!G||G.length%2!==0)&&(g=g.replace(/'/g,'"'));try{p=JSON.parse(g),U&&(p=Ii(Ii({},U),p))}catch(O){return this.logger.warn("failed parsing options string in nesting for key ".concat(x),O),"".concat(x).concat(R).concat(g)}return delete p.defaultValue,x}for(;f=this.nestingRegexp.exec(r);){var _=[],y=!1;if(f[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(f[1])){var m=f[1].split(this.formatSeparator).map(function(x){return x.trim()});f[1]=m.shift(),_=m,y=!0}if(h=n(v.call(this,f[1].trim(),p),p),h&&f[0]===r&&typeof h!="string")return h;typeof h!="string"&&(h=Jd(h)),h||(this.logger.warn("missed to resolve ".concat(f[1]," for nesting ").concat(r)),h=""),y&&(h=_.reduce(function(x,U){return o.format(x,U,a.lng,Ii(Ii({},a),{},{interpolationkey:f[1].trim()}))},h.trim())),r=r.replace(f[0],h),this.regexp.lastIndex=0}return r}}]),e}();function Wd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Jr(e){for(var t=1;t-1){var n=e.split("(");t=n[0].toLowerCase().trim();var o=n[1].substring(0,n[1].length-1);if(t==="currency"&&o.indexOf(":")<0)r.currency||(r.currency=o.trim());else if(t==="relativetime"&&o.indexOf(":")<0)r.range||(r.range=o.trim());else{var a=o.split(";");a.forEach(function(f){if(f){var h=f.split(":"),p=L1(h),v=p[0],_=p.slice(1),y=_.join(":").trim().replace(/^'+|'+$/g,"");r[v.trim()]||(r[v.trim()]=y),y==="false"&&(r[v.trim()]=!1),y==="true"&&(r[v.trim()]=!0),isNaN(y)||(r[v.trim()]=parseInt(y,10))}})}}return{formatName:t,formatOptions:r}}function $n(e){var t={};return function(n,o,a){var f=o+JSON.stringify(a),h=t[f];return h||(h=e(o,a),t[f]=h),h(n)}}var q1=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Wi(this,e),this.logger=er.create("formatter"),this.options=t,this.formats={number:$n(function(r,n){var o=new Intl.NumberFormat(r,n);return function(a){return o.format(a)}}),currency:$n(function(r,n){var o=new Intl.NumberFormat(r,Jr(Jr({},n),{},{style:"currency"}));return function(a){return o.format(a)}}),datetime:$n(function(r,n){var o=new Intl.DateTimeFormat(r,Jr({},n));return function(a){return o.format(a)}}),relativetime:$n(function(r,n){var o=new Intl.RelativeTimeFormat(r,Jr({},n));return function(a){return o.format(a,n.range||"day")}}),list:$n(function(r,n){var o=new Intl.ListFormat(r,Jr({},n));return function(a){return o.format(a)}})},this.init(t)}return Ki(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},o=n.interpolation;this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||","}},{key:"add",value:function(r,n){this.formats[r.toLowerCase().trim()]=n}},{key:"addCached",value:function(r,n){this.formats[r.toLowerCase().trim()]=$n(n)}},{key:"format",value:function(r,n,o,a){var f=this,h=n.split(this.formatSeparator),p=h.reduce(function(v,_){var y=X1(_),m=y.formatName,x=y.formatOptions;if(f.formats[m]){var U=v;try{var R=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},S=R.locale||R.lng||a.locale||a.lng||o;U=f.formats[m](v,S,Jr(Jr(Jr({},x),a),R))}catch(g){f.logger.warn(g)}return U}else f.logger.warn("there was no format function for ".concat(m));return v},r);return p}}]),e}();function Kd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Vd(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ib(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var rb=function(e){zl(r,e);var t=eb(r);function r(n,o,a){var f,h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Wi(this,r),f=t.call(this),Ql&&zr.call(Vr(f)),f.backend=n,f.store=o,f.services=a,f.languageUtils=a.languageUtils,f.options=h,f.logger=er.create("backendConnector"),f.waitingReads=[],f.maxParallelReads=h.maxParallelReads||10,f.readingCalls=0,f.maxRetries=h.maxRetries>=0?h.maxRetries:5,f.retryTimeout=h.retryTimeout>=1?h.retryTimeout:350,f.state={},f.queue=[],f.backend&&f.backend.init&&f.backend.init(a,h.backend,h),f}return Ki(r,[{key:"queueLoad",value:function(o,a,f,h){var p=this,v={},_={},y={},m={};return o.forEach(function(x){var U=!0;a.forEach(function(R){var S="".concat(x,"|").concat(R);!f.reload&&p.store.hasResourceBundle(x,R)?p.state[S]=2:p.state[S]<0||(p.state[S]===1?_[S]===void 0&&(_[S]=!0):(p.state[S]=1,U=!1,_[S]===void 0&&(_[S]=!0),v[S]===void 0&&(v[S]=!0),m[R]===void 0&&(m[R]=!0)))}),U||(y[x]=!0)}),(Object.keys(v).length||Object.keys(_).length)&&this.queue.push({pending:_,pendingCount:Object.keys(_).length,loaded:{},errors:[],callback:h}),{toLoad:Object.keys(v),pending:Object.keys(_),toLoadLanguages:Object.keys(y),toLoadNamespaces:Object.keys(m)}}},{key:"loaded",value:function(o,a,f){var h=o.split("|"),p=h[0],v=h[1];a&&this.emit("failedLoading",p,v,a),f&&this.store.addResourceBundle(p,v,f),this.state[o]=a?-1:2;var _={};this.queue.forEach(function(y){N1(y.loaded,[p],v),ib(y,o),a&&y.errors.push(a),y.pendingCount===0&&!y.done&&(Object.keys(y.loaded).forEach(function(m){_[m]||(_[m]={});var x=y.loaded[m];x.length&&x.forEach(function(U){_[m][U]===void 0&&(_[m][U]=!0)})}),y.done=!0,y.errors.length?y.callback(y.errors):y.callback())}),this.emit("loaded",_),this.queue=this.queue.filter(function(y){return!y.done})}},{key:"read",value:function(o,a,f){var h=this,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,v=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,_=arguments.length>5?arguments[5]:void 0;if(!o.length)return _(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:a,fcName:f,tried:p,wait:v,callback:_});return}return this.readingCalls++,this.backend[f](o,a,function(y,m){if(h.readingCalls--,h.waitingReads.length>0){var x=h.waitingReads.shift();h.read(x.lng,x.ns,x.fcName,x.tried,x.wait,x.callback)}if(y&&m&&p2&&arguments[2]!==void 0?arguments[2]:{},p=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),p&&p();typeof o=="string"&&(o=this.languageUtils.toResolveHierarchy(o)),typeof a=="string"&&(a=[a]);var v=this.queueLoad(o,a,h,p);if(!v.toLoad.length)return v.pending.length||p(),null;v.toLoad.forEach(function(_){f.loadOne(_)})}},{key:"load",value:function(o,a,f){this.prepareLoading(o,a,{},f)}},{key:"reload",value:function(o,a,f){this.prepareLoading(o,a,{reload:!0},f)}},{key:"loadOne",value:function(o){var a=this,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",h=o.split("|"),p=h[0],v=h[1];this.read(p,v,"read",void 0,void 0,function(_,y){_&&a.logger.warn("".concat(f,"loading namespace ").concat(v," for language ").concat(p," failed"),_),!_&&y&&a.logger.log("".concat(f,"loaded namespace ").concat(v," for language ").concat(p),y),a.loaded(o,_,y)})}},{key:"saveMissing",value:function(o,a,f,h,p){var v=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(a)){this.logger.warn('did not save key "'.concat(f,'" as the namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}f==null||f===""||(this.backend&&this.backend.create&&this.backend.create(o,a,f,h,null,Vd(Vd({},v),{},{isUpdate:p})),!(!o||!o[0])&&this.store.addResource(o[0],a,f,h))}}]),r}(zr);function nb(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var r={};if(ji(t[1])==="object"&&(r=t[1]),typeof t[1]=="string"&&(r.defaultValue=t[1]),typeof t[2]=="string"&&(r.tDescription=t[2]),ji(t[2])==="object"||ji(t[3])==="object"){var n=t[3]||t[2];Object.keys(n).forEach(function(o){r[o]=n[o]})}return r},interpolation:{escapeValue:!0,format:function(t,r,n,o){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function zd(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Qd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Hi(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Qa(){}function ab(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(r){typeof e[r]=="function"&&(e[r]=e[r].bind(e))})}var kl=function(e){zl(r,e);var t=sb(r);function r(){var n,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(Wi(this,r),n=t.call(this),Ql&&zr.call(Vr(n)),n.options=zd(o),n.services={},n.logger=er,n.modules={external:[]},ab(Vr(n)),a&&!n.isInitialized&&!o.isClone){if(!n.options.initImmediate)return n.init(o,a),ta(n,Vr(n));setTimeout(function(){n.init(o,a)},0)}return n}return Ki(r,[{key:"init",value:function(){var o=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f=arguments.length>1?arguments[1]:void 0;typeof a=="function"&&(f=a,a={}),!a.defaultNS&&a.defaultNS!==!1&&a.ns&&(typeof a.ns=="string"?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));var h=nb();this.options=Hi(Hi(Hi({},h),this.options),zd(a)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Hi(Hi({},h.interpolation),this.options.interpolation)),a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator);function p(g){return g?typeof g=="function"?new g:g:null}if(!this.options.isClone){this.modules.logger?er.init(p(this.modules.logger),this.options):er.init(null,this.options);var v;this.modules.formatter?v=this.modules.formatter:typeof Intl<"u"&&(v=q1);var _=new V1(this.options);this.store=new G1(this.options.resources,this.options);var y=this.services;y.logger=er,y.resourceStore=this.store,y.languageUtils=_,y.pluralResolver=new Z1(_,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),v&&(!this.options.interpolation.format||this.options.interpolation.format===h.interpolation.format)&&(y.formatter=p(v),y.formatter.init(y,this.options),this.options.interpolation.format=y.formatter.format.bind(y.formatter)),y.interpolator=new $1(this.options),y.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},y.backendConnector=new rb(p(this.modules.backend),y.resourceStore,y,this.options),y.backendConnector.on("*",function(g){for(var L=arguments.length,G=new Array(L>1?L-1:0),O=1;O1?L-1:0),O=1;O0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var x=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];x.forEach(function(g){o[g]=function(){var L;return(L=o.store)[g].apply(L,arguments)}});var U=["addResource","addResources","addResourceBundle","removeResourceBundle"];U.forEach(function(g){o[g]=function(){var L;return(L=o.store)[g].apply(L,arguments),o}});var R=mo(),S=function(){var L=function(O,P){o.isInitialized&&!o.initializedStoreOnce&&o.logger.warn("init: i18next is already initialized. You should call init just once!"),o.isInitialized=!0,o.options.isClone||o.logger.log("initialized",o.options),o.emit("initialized",o.options),R.resolve(P),f(O,P)};if(o.languages&&o.options.compatibilityAPI!=="v1"&&!o.isInitialized)return L(null,o.t.bind(o));o.changeLanguage(o.options.lng,L)};return this.options.resources||!this.options.initImmediate?S():setTimeout(S,0),R}},{key:"loadResources",value:function(o){var a=this,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qa,h=f,p=typeof o=="string"?o:this.language;if(typeof o=="function"&&(h=o),!this.options.resources||this.options.partialBundledLanguages){if(p&&p.toLowerCase()==="cimode")return h();var v=[],_=function(x){if(x){var U=a.services.languageUtils.toResolveHierarchy(x);U.forEach(function(R){v.indexOf(R)<0&&v.push(R)})}};if(p)_(p);else{var y=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);y.forEach(function(m){return _(m)})}this.options.preload&&this.options.preload.forEach(function(m){return _(m)}),this.services.backendConnector.load(v,this.options.ns,function(m){!m&&!a.resolvedLanguage&&a.language&&a.setResolvedLanguage(a.language),h(m)})}else h(null)}},{key:"reloadResources",value:function(o,a,f){var h=mo();return o||(o=this.languages),a||(a=this.options.ns),f||(f=Qa),this.services.backendConnector.reload(o,a,function(p){h.resolve(),f(p)}),h}},{key:"use",value:function(o){if(!o)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!o.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return o.type==="backend"&&(this.modules.backend=o),(o.type==="logger"||o.log&&o.warn&&o.error)&&(this.modules.logger=o),o.type==="languageDetector"&&(this.modules.languageDetector=o),o.type==="i18nFormat"&&(this.modules.i18nFormat=o),o.type==="postProcessor"&&Mm.addPostProcessor(o),o.type==="formatter"&&(this.modules.formatter=o),o.type==="3rdParty"&&this.modules.external.push(o),this}},{key:"setResolvedLanguage",value:function(o){if(!(!o||!this.languages)&&!(["cimode","dev"].indexOf(o)>-1))for(var a=0;a-1)&&this.store.hasLanguageSomeTranslations(f)){this.resolvedLanguage=f;break}}}},{key:"changeLanguage",value:function(o,a){var f=this;this.isLanguageChangingTo=o;var h=mo();this.emit("languageChanging",o);var p=function(m){f.language=m,f.languages=f.services.languageUtils.toResolveHierarchy(m),f.resolvedLanguage=void 0,f.setResolvedLanguage(m)},v=function(m,x){x?(p(x),f.translator.changeLanguage(x),f.isLanguageChangingTo=void 0,f.emit("languageChanged",x),f.logger.log("languageChanged",x)):f.isLanguageChangingTo=void 0,h.resolve(function(){return f.t.apply(f,arguments)}),a&&a(m,function(){return f.t.apply(f,arguments)})},_=function(m){!o&&!m&&f.services.languageDetector&&(m=[]);var x=typeof m=="string"?m:f.services.languageUtils.getBestMatchFromCodes(m);x&&(f.language||p(x),f.translator.language||f.translator.changeLanguage(x),f.services.languageDetector&&f.services.languageDetector.cacheUserLanguage(x)),f.loadResources(x,function(U){v(U,x)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?_(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(_):_(o),h}},{key:"getFixedT",value:function(o,a,f){var h=this,p=function v(_,y){var m;if(ji(y)!=="object"){for(var x=arguments.length,U=new Array(x>2?x-2:0),R=2;R1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var h=this.resolvedLanguage||this.languages[0],p=this.options?this.options.fallbackLng:!1,v=this.languages[this.languages.length-1];if(h.toLowerCase()==="cimode")return!0;var _=function(x,U){var R=a.services.backendConnector.state["".concat(x,"|").concat(U)];return R===-1||R===2};if(f.precheck){var y=f.precheck(this,_);if(y!==void 0)return y}return!!(this.hasResourceBundle(h,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||_(h,o)&&(!p||_(v,o)))}},{key:"loadNamespaces",value:function(o,a){var f=this,h=mo();return this.options.ns?(typeof o=="string"&&(o=[o]),o.forEach(function(p){f.options.ns.indexOf(p)<0&&f.options.ns.push(p)}),this.loadResources(function(p){h.resolve(),a&&a(p)}),h):(a&&a(),Promise.resolve())}},{key:"loadLanguages",value:function(o,a){var f=mo();typeof o=="string"&&(o=[o]);var h=this.options.preload||[],p=o.filter(function(v){return h.indexOf(v)<0});return p.length?(this.options.preload=h.concat(p),this.loadResources(function(v){f.resolve(),a&&a(v)}),f):(a&&a(),Promise.resolve())}},{key:"dir",value:function(o){if(o||(o=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!o)return"rtl";var a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return a.indexOf(this.services.languageUtils.getLanguagePartFromCode(o))>-1||o.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var o=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qa,h=Hi(Hi(Hi({},this.options),a),{isClone:!0}),p=new r(h);(a.debug!==void 0||a.prefix!==void 0)&&(p.logger=p.logger.clone(a));var v=["store","services","language"];return v.forEach(function(_){p[_]=o[_]}),p.services=Hi({},this.services),p.services.utils={hasLoadedNamespace:p.hasLoadedNamespace.bind(p)},p.translator=new jd(p.services,p.options),p.translator.on("*",function(_){for(var y=arguments.length,m=new Array(y>1?y-1:0),x=1;x0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new kl(e,t)});var Ct=kl.createInstance();Ct.createInstance=kl.createInstance;Ct.createInstance;Ct.init;Ct.loadResources;Ct.reloadResources;Ct.use;Ct.changeLanguage;Ct.getFixedT;Ct.t;Ct.exists;Ct.setDefaultNamespace;Ct.hasLoadedNamespace;Ct.loadNamespaces;Ct.loadLanguages;var Cm=[],lb=Cm.forEach,ub=Cm.slice;function fb(e){return lb.call(ub.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var Yd=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,cb=function(t,r,n){var o=n||{};o.path=o.path||"/";var a=encodeURIComponent(r),f="".concat(t,"=").concat(a);if(o.maxAge>0){var h=o.maxAge-0;if(Number.isNaN(h))throw new Error("maxAge should be a Number");f+="; Max-Age=".concat(Math.floor(h))}if(o.domain){if(!Yd.test(o.domain))throw new TypeError("option domain is invalid");f+="; Domain=".concat(o.domain)}if(o.path){if(!Yd.test(o.path))throw new TypeError("option path is invalid");f+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");f+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(f+="; HttpOnly"),o.secure&&(f+="; Secure"),o.sameSite){var p=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(p){case!0:f+="; SameSite=Strict";break;case"lax":f+="; SameSite=Lax";break;case"strict":f+="; SameSite=Strict";break;case"none":f+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return f},Hd={create:function(t,r,n,o){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+n*60*1e3)),o&&(a.domain=o),document.cookie=cb(t,encodeURIComponent(r),a)},read:function(t){for(var r="".concat(t,"="),n=document.cookie.split(";"),o=0;o-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=n.substring(1),a=o.split("&"),f=0;f0){var p=a[f].substring(0,h);p===t.lookupQuerystring&&(r=a[f].substring(h+1))}}}return r}},vo=null,Zd=function(){if(vo!==null)return vo;try{vo=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{vo=!1}return vo},db={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&Zd()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&Zd()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},_o=null,$d=function(){if(_o!==null)return _o;try{_o=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{_o=!1}return _o},gb={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&$d()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&$d()&&window.sessionStorage.setItem(r.lookupSessionStorage,t)}},yb={name:"navigator",lookup:function(t){var r=[];if(typeof navigator<"u"){if(navigator.languages)for(var n=0;n0?r:void 0}},mb={name:"htmlTag",lookup:function(t){var r,n=t.htmlTag||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},vb={name:"path",lookup:function(t){var r;if(typeof window<"u"){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof n[t.lookupFromPathIndex]!="string")return;r=n[t.lookupFromPathIndex].replace("/","")}else r=n[0].replace("/","")}return r}},_b={name:"subdomain",lookup:function(t){var r=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,n=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[r]}};function wb(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Tm=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Wi(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return Ki(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=r,this.options=fb(n,this.options||{},wb()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(hb),this.addDetector(pb),this.addDetector(db),this.addDetector(gb),this.addDetector(yb),this.addDetector(mb),this.addDetector(vb),this.addDetector(_b)}},{key:"addDetector",value:function(r){this.detectors[r.name]=r}},{key:"detect",value:function(r){var n=this;r||(r=this.options.order);var o=[];return r.forEach(function(a){if(n.detectors[a]){var f=n.detectors[a].lookup(n.options);f&&typeof f=="string"&&(f=[f]),f&&(o=o.concat(f))}}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(r,n){var o=this;n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(r)>-1||n.forEach(function(a){o.detectors[a]&&o.detectors[a].cacheUserLanguage(r,o.options)}))}}]),e}();Tm.type="languageDetector";const Em={en:{translation:{"language-name":"english",toolbar:{run:"Run all code (ctrl+shift+enter)",upload:"upload to gallery",clear:"clear all",shuffle:"show random sketch",random:"make random change","load-extension":"load library or extension","show-info":"show info window","hide-info":"hide info window"},info:{title:"hydra",subtitle:"live coding video synth",description:"Hydra is live code-able video synth and coding environment that runs directly in the browser. It is free and open-source and made for beginners and experts alike.","get-started-title":"To get started:","get-started-list":["Close this window","Change some numbers","Type Ctrl + Shift + Enter"],"description-detailed":"Hydra is written in JavaScript and compiles to WebGL under the hood. The syntax is inspired by analog modular synthesis, in which chaining or patching a set of transformations together generates a visual result.",uses:"Hydra can be used:","uses-list":["to mix and add effects to camera feeds, screenshares, live streams, and videos","to create generative and audio-reactive visuals, and share them online with others","in combination with other javascript libraries such as P5.js, Tone.js, THREE.js, or gibber","to add interactive video effects to a website","to experiment with and learn about video feedback, fractals, and pixel operations","to stream video between browsers and live-jam with others online"],author:"Created by olivia.","more-info":"For more information and instructions, see: the interactive documentation, a list of hydra functions, the community database of projects and tutorials, a gallery of user-generated sketches, and the source code on github,","more-info-forums":"There is also an active Discord server and facebook group for hydra users+contributors.",support:"If you enjoy using Hydra, please consider supporting continued development <3 ."},extensions:{"about-extensions":"Show community extensions for hydra-synth.","show-example":"Load and run {{extension-name}} example.","show-library":"Add code for loading {{extension-name}} to the top of the current sketch.","show-docs":"Documentation of usage for {{extension-name}}"}}}},bb=["ja","es","ar","id","pt-br","ch","ko","fr","de"],xb=e=>`https://raw.githubusercontent.com/hydra-synth/l10n/main/${e}/editor.json`;Ct.use(Tm).init({debug:!0,fallbackLng:"en",partialBundledLanguages:!0,resources:Em});function Sb(e,t){const r={};let n=new URLSearchParams(window.location.search),o=n.get("l10n-lang"),a=n.get("l10n-url");bb.forEach(p=>{h(p,xb(p))}),o!==null&&a!==null&&h(o,a),f(),t.on("set language",p=>{Ct.changeLanguage(p,(v,_)=>{e.translation.selectedLanguage=p,t.emit("render")})});function f(){Object.keys(Em).forEach(p=>{const v=p.split("-")[0];r[v]=Ct.getFixedT(v)("language-name")}),e.translation={t:Ct.t,languages:r,selectedLanguage:Ct.language,textDirection:Ct.language==="ar"?"rtl":"ltr"}}function h(p="es",v){const _="color: purple; background: orange; font-size: 14px;padding:10px";console.log(`%cloading translation for ${p} from ${v}`,_),fetch(v).then(y=>y.ok?y.json():y.text().then(m=>{throw new Error(m)})).then(y=>{window.i18n=Ct,console.log("adding language",p,y);const m=p.split("-")[0];Ct.addResourceBundle(m,"translation",y),f(),t.emit("render")})}}const Mb="https://raw.githubusercontent.com/hydra-synth/hydra-extensions/main/";async function Cb(e,t){e.extensions={baseURL:Mb,selectedCategoryIndex:0,categories:[{name:"extensions",slug:"extensions",entries:[],hasLoaded:!1},{name:"external libraries",slug:"external-libraries",entries:[],hasLoaded:!1},{name:"examples",slug:"examples",entries:[],hasLoaded:!1}]},t.on("extensions: select category",(r=e.extensions.selectedCategoryIndex)=>{e.extensions.selectedCategoryIndex=r,t.emit("render");const n=e.extensions.categories[r];if(!n.hasLoaded){const o=e.extensions.baseURL+n.slug+".json?laskd";fetch(o).then(a=>a.json()).then(a=>{console.log("loaded d",a),a.forEach(f=>{f.thumbnail=e.extensions.baseURL+"thumbnails/"+f.thumbnail}),n.entries=a,t.emit("render")})}}),t.on("extensions: add to editor",r=>{const{categories:n,selectedCategoryIndex:o}=e.extensions,a=n[o].entries[r].load;t.emit("editor: add code to top",a)}),t.on("extensions: load example",(r,n)=>{const{categories:o,selectedCategoryIndex:a}=e.extensions,f=o[a].entries[r].examples[n],h=new URL(f);console.log(h,e.gallery),e.gallery.setSketchFromURL(h.search,p=>{t.emit("load and eval code",p)})})}function Tb(e,t){t.on("editor: randomize",function(r){const n=e.editor.editor;r.shiftKey?n.mutator.doUndo():(n.mutator.mutate({reroll:!1,changeTransform:r.metaKey}),n.formatCode(),t.emit("gallery: save to URL",n.getValue()))}),t.on("editor: add code to top",r=>{e.editor.editor.addCodeToTop(r)}),t.on("editor: format code",()=>{e.editor.editor.formatCode()}),t.on("editor: load code",r=>{e.editor.editor.setValue(r)}),t.on("editor: eval all",function(){const r=e.editor.editor,n=r.getValue();t.emit("repl: eval",n,(o,a)=>{r.flashCode(),a||t.emit("gallery: save to URL",n)})})}var pc={exports:{}},km={exports:{}};(function(e){e.exports=t;function t(n){if(n)return r(n)}function r(n){for(var o in t.prototype)n[o]=t.prototype[o];return n}t.prototype.on=t.prototype.addEventListener=function(n,o){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(o),this},t.prototype.once=function(n,o){function a(){this.off(n,a),o.apply(this,arguments)}return a.fn=o,this.on(n,a),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(n,o){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var a=this._callbacks["$"+n];if(!a)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var f,h=0;h"u"||!Dt?Qe:Dt(Uint8Array),bn={"%AggregateError%":typeof AggregateError>"u"?Qe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Qe:ArrayBuffer,"%ArrayIteratorPrototype%":Xn&&Dt?Dt([][Symbol.iterator]()):Qe,"%AsyncFromSyncIteratorPrototype%":Qe,"%AsyncFunction%":os,"%AsyncGenerator%":os,"%AsyncGeneratorFunction%":os,"%AsyncIteratorPrototype%":os,"%Atomics%":typeof Atomics>"u"?Qe:Atomics,"%BigInt%":typeof BigInt>"u"?Qe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Qe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Qe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Qe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Qe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Qe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Qe:FinalizationRegistry,"%Function%":Am,"%GeneratorFunction%":os,"%Int8Array%":typeof Int8Array>"u"?Qe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Qe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Qe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Xn&&Dt?Dt(Dt([][Symbol.iterator]())):Qe,"%JSON%":typeof JSON=="object"?JSON:Qe,"%Map%":typeof Map>"u"?Qe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Xn||!Dt?Qe:Dt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Qe:Promise,"%Proxy%":typeof Proxy>"u"?Qe:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Qe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Qe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Xn||!Dt?Qe:Dt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Qe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Xn&&Dt?Dt(""[Symbol.iterator]()):Qe,"%Symbol%":Xn?Symbol:Qe,"%SyntaxError%":ys,"%ThrowTypeError%":Db,"%TypedArray%":Pb,"%TypeError%":cs,"%Uint8Array%":typeof Uint8Array>"u"?Qe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Qe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Qe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Qe:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Qe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Qe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Qe:WeakSet};if(Dt)try{null.error}catch(e){var Gb=Dt(Dt(e));bn["%Error.prototype%"]=Gb}var Wb=function e(t){var r;if(t==="%AsyncFunction%")r=of("async function () {}");else if(t==="%GeneratorFunction%")r=of("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=of("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&Dt&&(r=Dt(o.prototype))}return bn[t]=r,r},eg={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ia=th,Al=Fb,Kb=ia.call(Function.call,Array.prototype.concat),Vb=ia.call(Function.apply,Array.prototype.splice),tg=ia.call(Function.call,String.prototype.replace),Rl=ia.call(Function.call,String.prototype.slice),zb=ia.call(Function.call,RegExp.prototype.exec),Qb=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Yb=/\\(\\)?/g,Hb=function(t){var r=Rl(t,0,1),n=Rl(t,-1);if(r==="%"&&n!=="%")throw new ys("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new ys("invalid intrinsic syntax, expected opening `%`");var o=[];return tg(t,Qb,function(a,f,h,p){o[o.length]=h?tg(p,Yb,"$1"):f||a}),o},Zb=function(t,r){var n=t,o;if(Al(eg,n)&&(o=eg[n],n="%"+o[0]+"%"),Al(bn,n)){var a=bn[n];if(a===os&&(a=Wb(n)),typeof a>"u"&&!r)throw new cs("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:a}}throw new ys("intrinsic "+t+" does not exist!")},ih=function(t,r){if(typeof t!="string"||t.length===0)throw new cs("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new cs('"allowMissing" argument must be a boolean');if(zb(/^%?[^%]*%?$/,t)===null)throw new ys("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Hb(t),o=n.length>0?n[0]:"",a=Zb("%"+o+"%",r),f=a.name,h=a.value,p=!1,v=a.alias;v&&(o=v[0],Vb(n,Kb([0,1],v)));for(var _=1,y=!0;_=n.length){var R=wn(h,m);y=!!R,y&&"get"in R&&!("originalValue"in R.get)?h=R.get:h=h[m]}else y=Al(h,m),h=h[m];y&&!p&&(bn[f]=h)}}return h},Rm={exports:{}};(function(e){var t=th,r=ih,n=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||t.call(o,n),f=r("%Object.getOwnPropertyDescriptor%",!0),h=r("%Object.defineProperty%",!0),p=r("%Math.max%");if(h)try{h({},"a",{value:1})}catch{h=null}e.exports=function(y){var m=a(t,o,arguments);if(f&&h){var x=f(m,"length");x.configurable&&h(m,"length",{value:1+p(0,y.length-(arguments.length-1))})}return m};var v=function(){return a(t,n,arguments)};h?h(e.exports,"apply",{value:v}):e.exports.apply=v})(Rm);var $b=Rm.exports,Lm=ih,Um=$b,Xb=Um(Lm("String.prototype.indexOf")),qb=function(t,r){var n=Lm(t,!!r);return typeof n=="function"&&Xb(t,".prototype.")>-1?Um(n):n};const ex={},tx=Object.freeze(Object.defineProperty({__proto__:null,default:ex},Symbol.toStringTag,{value:"Module"})),bs=L_(tx);var rh=typeof Map=="function"&&Map.prototype,lf=Object.getOwnPropertyDescriptor&&rh?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ll=rh&&lf&&typeof lf.get=="function"?lf.get:null,ig=rh&&Map.prototype.forEach,nh=typeof Set=="function"&&Set.prototype,uf=Object.getOwnPropertyDescriptor&&nh?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ul=nh&&uf&&typeof uf.get=="function"?uf.get:null,rg=nh&&Set.prototype.forEach,ix=typeof WeakMap=="function"&&WeakMap.prototype,Lo=ix?WeakMap.prototype.has:null,rx=typeof WeakSet=="function"&&WeakSet.prototype,Uo=rx?WeakSet.prototype.has:null,nx=typeof WeakRef=="function"&&WeakRef.prototype,ng=nx?WeakRef.prototype.deref:null,sx=Boolean.prototype.valueOf,ox=Object.prototype.toString,ax=Function.prototype.toString,lx=String.prototype.match,sh=String.prototype.slice,jr=String.prototype.replace,ux=String.prototype.toUpperCase,sg=String.prototype.toLowerCase,Im=RegExp.prototype.test,og=Array.prototype.concat,Xi=Array.prototype.join,fx=Array.prototype.slice,ag=Math.floor,dc=typeof BigInt=="function"?BigInt.prototype.valueOf:null,ff=Object.getOwnPropertySymbols,gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ms=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Yt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ms||"symbol")?Symbol.toStringTag:null,Jm=Object.prototype.propertyIsEnumerable,lg=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function ug(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Im.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-ag(-e):ag(e);if(n!==e){var o=String(n),a=sh.call(t,o.length+1);return jr.call(o,r,"$&_")+"."+jr.call(jr.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return jr.call(t,r,"$&_")}var yc=bs,fg=yc.custom,cg=Om(fg)?fg:null,cx=function e(t,r,n,o){var a=r||{};if(Br(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Br(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var f=Br(a,"customInspect")?a.customInspect:!0;if(typeof f!="boolean"&&f!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Br(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Br(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var h=a.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Fm(t,a);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var p=String(t);return h?ug(t,p):p}if(typeof t=="bigint"){var v=String(t)+"n";return h?ug(t,v):v}var _=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=_&&_>0&&typeof t=="object")return mc(t)?"[Array]":"[Object]";var y=Ax(a,n);if(typeof o>"u")o=[];else if(Bm(o,t)>=0)return"[Circular]";function m(ce,ye,re){if(ye&&(o=fx.call(o),o.push(ye)),re){var ie={depth:a.depth};return Br(a,"quoteStyle")&&(ie.quoteStyle=a.quoteStyle),e(ce,ie,n+1,o)}return e(ce,a,n+1,o)}if(typeof t=="function"&&!hg(t)){var x=wx(t),U=Ya(t,m);return"[Function"+(x?": "+x:" (anonymous)")+"]"+(U.length>0?" { "+Xi.call(U,", ")+" }":"")}if(Om(t)){var R=ms?jr.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):gc.call(t);return typeof t=="object"&&!ms?wo(R):R}if(Tx(t)){for(var S="<"+sg.call(String(t.nodeName)),g=t.attributes||[],L=0;L",S}if(mc(t)){if(t.length===0)return"[]";var G=Ya(t,m);return y&&!kx(G)?"["+vc(G,y)+"]":"[ "+Xi.call(G,", ")+" ]"}if(dx(t)){var O=Ya(t,m);return!("cause"in Error.prototype)&&"cause"in t&&!Jm.call(t,"cause")?"{ ["+String(t)+"] "+Xi.call(og.call("[cause]: "+m(t.cause),O),", ")+" }":O.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Xi.call(O,", ")+" }"}if(typeof t=="object"&&f){if(cg&&typeof t[cg]=="function"&&yc)return yc(t,{depth:_-n});if(f!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(bx(t)){var P=[];return ig&&ig.call(t,function(ce,ye){P.push(m(ye,t,!0)+" => "+m(ce,t))}),pg("Map",Ll.call(t),P,y)}if(Mx(t)){var F=[];return rg&&rg.call(t,function(ce){F.push(m(ce,t))}),pg("Set",Ul.call(t),F,y)}if(xx(t))return cf("WeakMap");if(Cx(t))return cf("WeakSet");if(Sx(t))return cf("WeakRef");if(yx(t))return wo(m(Number(t)));if(vx(t))return wo(m(dc.call(t)));if(mx(t))return wo(sx.call(t));if(gx(t))return wo(m(String(t)));if(!px(t)&&!hg(t)){var V=Ya(t,m),D=lg?lg(t)===Object.prototype:t instanceof Object||t.constructor===Object,ee=t instanceof Object?"":"null prototype",A=!D&&Yt&&Object(t)===t&&Yt in t?sh.call(Hr(t),8,-1):ee?"Object":"",q=D||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",$=q+(A||ee?"["+Xi.call(og.call([],A||[],ee||[]),": ")+"] ":"");return V.length===0?$+"{}":y?$+"{"+vc(V,y)+"}":$+"{ "+Xi.call(V,", ")+" }"}return String(t)};function Nm(e,t,r){var n=(r.quoteStyle||t)==="double"?'"':"'";return n+e+n}function hx(e){return jr.call(String(e),/"/g,""")}function mc(e){return Hr(e)==="[object Array]"&&(!Yt||!(typeof e=="object"&&Yt in e))}function px(e){return Hr(e)==="[object Date]"&&(!Yt||!(typeof e=="object"&&Yt in e))}function hg(e){return Hr(e)==="[object RegExp]"&&(!Yt||!(typeof e=="object"&&Yt in e))}function dx(e){return Hr(e)==="[object Error]"&&(!Yt||!(typeof e=="object"&&Yt in e))}function gx(e){return Hr(e)==="[object String]"&&(!Yt||!(typeof e=="object"&&Yt in e))}function yx(e){return Hr(e)==="[object Number]"&&(!Yt||!(typeof e=="object"&&Yt in e))}function mx(e){return Hr(e)==="[object Boolean]"&&(!Yt||!(typeof e=="object"&&Yt in e))}function Om(e){if(ms)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!gc)return!1;try{return gc.call(e),!0}catch{}return!1}function vx(e){if(!e||typeof e!="object"||!dc)return!1;try{return dc.call(e),!0}catch{}return!1}var _x=Object.prototype.hasOwnProperty||function(e){return e in this};function Br(e,t){return _x.call(e,t)}function Hr(e){return ox.call(e)}function wx(e){if(e.name)return e.name;var t=lx.call(ax.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function Bm(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;rt.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Fm(sh.call(e,0,t.maxStringLength),t)+n}var o=jr.call(jr.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Ex);return Nm(o,"single",t)}function Ex(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+ux.call(t.toString(16))}function wo(e){return"Object("+e+")"}function cf(e){return e+" { ? }"}function pg(e,t,r,n){var o=n?vc(r,n):Xi.call(r,", ");return e+" ("+t+") {"+o+"}"}function kx(e){for(var t=0;t=0)return!1;return!0}function Ax(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=Xi.call(Array(e.indent+1)," ");else return null;return{base:r,prev:Xi.call(Array(t+1),r)}}function vc(e,t){if(e.length===0)return"";var r=` +`+t.prev+t.base;return r+Xi.call(e,","+r)+` +`+t.prev}function Ya(e,t){var r=mc(e),n=[];if(r){n.length=e.length;for(var o=0;o1;){var r=t.pop(),n=r.obj[r.prop];if(mn(n)){for(var o=[],a=0;a=48&&v<=57||v>=65&&v<=90||v>=97&&v<=122||a===Kx.RFC1738&&(v===40||v===41)){h+=f.charAt(p);continue}if(v<128){h=h+Zi[v];continue}if(v<2048){h=h+(Zi[192|v>>6]+Zi[128|v&63]);continue}if(v<55296||v>=57344){h=h+(Zi[224|v>>12]+Zi[128|v>>6&63]+Zi[128|v&63]);continue}p+=1,v=65536+((v&1023)<<10|f.charCodeAt(p)&1023),h+=Zi[240|v>>18]+Zi[128|v>>12&63]+Zi[128|v>>6&63]+Zi[128|v&63]}return h},Zx=function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],o=0;o"u"&&(G=0)}if(typeof p=="function"?g=p(r,g):g instanceof Date?g=y(g):n==="comma"&&pr(g)&&(g=wl.maybeMap(g,function(ie){return ie instanceof Date?y(ie):ie})),g===null){if(a)return h&&!U?h(r,zt.encoder,R,"key",m):r;g=""}if(nS(g)||wl.isBuffer(g)){if(h){var F=U?r:h(r,zt.encoder,R,"key",m);return[x(F)+"="+x(h(g,zt.encoder,R,"value",m))]}return[x(r)+"="+x(String(g))]}var V=[];if(typeof g>"u")return V;var D;if(n==="comma"&&pr(g))U&&h&&(g=wl.maybeMap(g,h)),D=[{value:g.length>0?g.join(",")||null:void 0}];else if(pr(p))D=p;else{var ee=Object.keys(g);D=v?ee.sort(v):ee}for(var A=o&&pr(g)&&g.length===1?r+"[]":r,q=0;q"u"?zt.allowDots:!!t.allowDots,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:zt.charsetSentinel,delimiter:typeof t.delimiter>"u"?zt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:zt.encode,encoder:typeof t.encoder=="function"?t.encoder:zt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:zt.encodeValuesOnly,filter:a,format:n,formatter:o,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:zt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:zt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:zt.strictNullHandling}},aS=function(e,t){var r=e,n=oS(t),o,a;typeof n.filter=="function"?(a=n.filter,r=a("",r)):pr(n.filter)&&(a=n.filter,o=a);var f=[];if(typeof r!="object"||r===null)return"";var h;t&&t.arrayFormat in dg?h=t.arrayFormat:t&&"indices"in t?h=t.indices?"indices":"repeat":h="indices";var p=dg[h];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var v=p==="comma"&&t&&t.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var _=Pm(),y=0;y0?U+x:""},vs=jm,_c=Object.prototype.hasOwnProperty,lS=Array.isArray,Ft={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:vs.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},uS=function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},Wm=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},fS="utf8=%26%2310003%3B",cS="utf8=%E2%9C%93",hS=function(t,r){var n={__proto__:null},o=r.ignoreQueryPrefix?t.replace(/^\?/,""):t,a=r.parameterLimit===1/0?void 0:r.parameterLimit,f=o.split(r.delimiter,a),h=-1,p,v=r.charset;if(r.charsetSentinel)for(p=0;p-1&&(U=lS(U)?[U]:U),_c.call(n,x)?n[x]=vs.combine(n[x],U):n[x]=U}return n},pS=function(e,t,r,n){for(var o=n?t:Wm(t,r),a=e.length-1;a>=0;--a){var f,h=e[a];if(h==="[]"&&r.parseArrays)f=[].concat(o);else{f=r.plainObjects?Object.create(null):{};var p=h.charAt(0)==="["&&h.charAt(h.length-1)==="]"?h.slice(1,-1):h,v=parseInt(p,10);!r.parseArrays&&p===""?f={0:o}:!isNaN(v)&&h!==p&&String(v)===p&&v>=0&&r.parseArrays&&v<=r.arrayLimit?(f=[],f[v]=o):p!=="__proto__"&&(f[p]=o)}o=f}return o},dS=function(t,r,n,o){if(t){var a=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,f=/(\[[^[\]]*])/,h=/(\[[^[\]]*])/g,p=n.depth>0&&f.exec(a),v=p?a.slice(0,p.index):a,_=[];if(v){if(!n.plainObjects&&_c.call(Object.prototype,v)&&!n.allowPrototypes)return;_.push(v)}for(var y=0;n.depth>0&&(p=h.exec(a))!==null&&y"u"?Ft.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?Ft.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Ft.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Ft.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Ft.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Ft.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Ft.comma,decoder:typeof t.decoder=="function"?t.decoder:Ft.decoder,delimiter:typeof t.delimiter=="string"||vs.isRegExp(t.delimiter)?t.delimiter:Ft.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Ft.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Ft.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Ft.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Ft.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Ft.strictNullHandling}},yS=function(e,t){var r=gS(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof e=="string"?hS(e,r):e,o=r.plainObjects?Object.create(null):{},a=Object.keys(n),f=0;f=a.length?{done:!0}:{done:!1,value:a[p++]}},e:function(U){throw U},f:v}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var _=!0,y=!1,m;return{s:function(){h=h.call(a)},n:function(){var U=h.next();return _=U.done,U},e:function(U){y=!0,m=U},f:function(){try{!_&&h.return!=null&&h.return()}finally{if(y)throw m}}}}function n(a,f){if(a){if(typeof a=="string")return o(a,f);var h=Object.prototype.toString.call(a).slice(8,-1);if(h==="Object"&&a.constructor&&(h=a.constructor.name),h==="Map"||h==="Set")return Array.from(a);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return o(a,f)}}function o(a,f){(f==null||f>a.length)&&(f=a.length);for(var h=0,p=new Array(f);h=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(e,t);if(r===!0)return!0;if(r===!1)return!1}catch(n){console.error(n)}return!!(t&&t.status&&SS.has(t.status)||e&&(e.code&&xS.has(e.code)||e.timeout&&e.code==="ECONNABORTED"||e.crossDomain))};st.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()};st.prototype.then=function(e,t){var r=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(o,a){n.on("abort",function(){if(!(r._maxRetries&&r._maxRetries>r._retries)){if(r.timedout&&r.timedoutError){a(r.timedoutError);return}var f=new Error("Aborted");f.code="ABORTED",f.status=r.status,f.method=r.method,f.url=r.url,a(f)}}),n.end(function(f,h){f?a(f):o(h)})})}return this._fullfilledPromise.then(e,t)};st.prototype.catch=function(e){return this.then(void 0,e)};st.prototype.use=function(e){return e(this),this};st.prototype.ok=function(e){if(typeof e!="function")throw new Error("Callback required");return this._okCallback=e,this};st.prototype._isResponseOK=function(e){return e?this._okCallback?this._okCallback(e):e.status>=200&&e.status<300:!1};st.prototype.get=function(e){return this._header[e.toLowerCase()]};st.prototype.getHeader=st.prototype.get;st.prototype.set=function(e,t){if(Il(e)){for(var r in e)Fo(e,r)&&this.set(r,e[r]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this};st.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this};st.prototype.field=function(e,t,r){if(e==null)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(Il(e)){for(var n in e)Fo(e,n)&&this.field(n,e[n]);return this}if(Array.isArray(t)){for(var o in t)Fo(t,o)&&this.field(e,t[o]);return this}if(t==null)throw new Error(".field(name, val) val can not be empty");return typeof t=="boolean"&&(t=String(t)),r?this._getFormData().append(e,t,r):this._getFormData().append(e,t),this};st.prototype.abort=function(){if(this._aborted)return this;if(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req){if(gf.gte(process.version,"v13.0.0")&&gf.lt(process.version,"v14.0.0"))throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes");gf.gte(process.version,"v14.0.0")&&(this.req.destroyed=!0),this.req.abort()}return this.clearTimeout(),this.emit("abort"),this};st.prototype._auth=function(e,t,r,n){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(e,":").concat(t))));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer ".concat(e));break}return this};st.prototype.withCredentials=function(e){return e===void 0&&(e=!0),this._withCredentials=e,this};st.prototype.redirects=function(e){return this._maxRedirects=e,this};st.prototype.maxResponseSize=function(e){if(typeof e!="number")throw new TypeError("Invalid argument");return this._maxResponseSize=e,this};st.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}};st.prototype.send=function(e){var t=Il(e),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(t&&Il(this._data))for(var n in e)Fo(e,n)&&(this._data[n]=e[n]);else typeof e=="string"?(r||this.type("form"),r=this._header["content-type"],r&&(r=r.toLowerCase().trim()),r==="application/x-www-form-urlencoded"?this._data=this._data?"".concat(this._data,"&").concat(e):e:this._data=(this._data||"")+e):this._data=e;return!t||this._isHost(e)?this:(r||this.type("json"),this)};st.prototype.sortQuery=function(e){return this._sort=typeof e>"u"?!0:e,this};st.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.includes("?")?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var r=this.url.slice(t+1).split("&");typeof this._sort=="function"?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,t)+"?"+r.join("&")}}};st.prototype._appendQueryString=function(){console.warn("Unsupported")};st.prototype._timeoutError=function(e,t,r){if(!this._aborted){var n=new Error("".concat(e+t,"ms exceeded"));n.timeout=t,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}};st.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")},this._responseTimeout))};var yf=Yl,MS=Hl;function Hl(){}Hl.prototype.get=function(e){return this.header[e.toLowerCase()]};Hl.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=yf.type(t);var r=yf.params(t);for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(this[n]=r[n]);this.links={};try{e.link&&(this.links=yf.parseLinks(e.link))}catch{}};Hl.prototype._setStatusProperties=function(e){var t=Math.trunc(e/100);this.statusCode=e,this.status=this.statusCode,this.statusType=t,this.info=t===1,this.ok=t===2,this.redirect=t===3,this.clientError=t===4,this.serverError=t===5,this.error=t===4||t===5?this.toError():!1,this.created=e===201,this.accepted=e===202,this.noContent=e===204,this.badRequest=e===400,this.unauthorized=e===401,this.notAcceptable=e===406,this.forbidden=e===403,this.notFound=e===404,this.unprocessableEntity=e===422};function CS(e){return kS(e)||ES(e)||Vm(e)||TS()}function TS(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ES(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kS(e){if(Array.isArray(e))return bc(e)}function AS(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Vm(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(v){throw v},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,f=!1,h;return{s:function(){r=r.call(e)},n:function(){var v=r.next();return a=v.done,v},e:function(v){f=!0,h=v},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(f)throw h}}}}function Vm(e,t){if(e){if(typeof e=="string")return bc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bc(e,t)}}function bc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=re.length?{done:!0}:{done:!1,value:re[X++]}},e:function(Ie){throw Ie},f:fe}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Me=!0,we=!1,Re;return{s:function(){K=K.call(re)},n:function(){var Ie=K.next();return Me=Ie.done,Ie},e:function(Ie){we=!0,Re=Ie},f:function(){try{!Me&&K.return!=null&&K.return()}finally{if(we)throw Re}}}}function o(re,ie){if(re){if(typeof re=="string")return a(re,ie);var K=Object.prototype.toString.call(re).slice(8,-1);if(K==="Object"&&re.constructor&&(K=re.constructor.name),K==="Map"||K==="Set")return Array.from(re);if(K==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(K))return a(re,ie)}}function a(re,ie){(ie==null||ie>re.length)&&(ie=re.length);for(var K=0,X=new Array(ie);K"u"?(console.warn("Using browser-only version of superagent in non-browser environment"),f=void 0):f=self;var h=Cn,p=yw,v=wS,_=bS,y=Yl,m=y.isObject,x=y.mixin,U=y.hasOwn,R=MS,S=LS;function g(){}e.exports=function(re,ie){return typeof ie=="function"?new t.Request("GET",re).end(ie):arguments.length===1?new t.Request("GET",re):new t.Request(re,ie)},t=e.exports;var L=t;t.Request=A,L.getXHR=function(){if(f.XMLHttpRequest&&(!f.location||f.location.protocol!=="file:"||!f.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch{}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch{}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch{}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch{}throw new Error("Browser-only version of superagent could not find XHR")};var G="".trim?function(re){return re.trim()}:function(re){return re.replace(/(^\s*|\s*$)/g,"")};function O(re){if(!m(re))return re;var ie=[];for(var K in re)U(re,K)&&P(ie,K,re[K]);return ie.join("&")}function P(re,ie,K){if(K!==void 0){if(K===null){re.push(encodeURI(ie));return}if(Array.isArray(K)){var X=n(K),fe;try{for(X.s();!(fe=X.n()).done;){var Me=fe.value;P(re,ie,Me)}}catch(Re){X.e(Re)}finally{X.f()}}else if(m(K))for(var we in K)U(K,we)&&P(re,"".concat(ie,"[").concat(we,"]"),K[we]);else re.push(encodeURI(ie)+"="+encodeURIComponent(K))}}L.serializeObject=O;function F(re){for(var ie={},K=re.split("&"),X,fe,Me=0,we=K.length;Me"u"?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var ie=this.xhr.status;ie===1223&&(ie=204),this._setStatusProperties(ie),this.headers=V(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),this.text===null&&re._responseType?this.body=this.xhr.response:this.body=this.req.method==="HEAD"?null:this._parseBody(this.text?this.text:this.xhr.response)}x(ee.prototype,R.prototype),ee.prototype._parseBody=function(re){var ie=L.parse[this.type];return this.req._parser?this.req._parser(this,re):(!ie&&D(this.type)&&(ie=L.parse["application/json"]),ie&&re&&(re.length>0||re instanceof Object)?ie(re):null)},ee.prototype.toError=function(){var re=this.req,ie=re.method,K=re.url,X="cannot ".concat(ie," ").concat(K," (").concat(this.status,")"),fe=new Error(X);return fe.status=this.status,fe.method=ie,fe.url=K,fe},L.Response=ee;function A(re,ie){var K=this;this._query=this._query||[],this.method=re,this.url=ie,this.header={},this._header={},this.on("end",function(){var X=null,fe=null;try{fe=new ee(K)}catch(we){return X=new Error("Parser is unable to parse the response"),X.parse=!0,X.original=we,K.xhr?(X.rawResponse=typeof K.xhr.responseType>"u"?K.xhr.responseText:K.xhr.response,X.status=K.xhr.status?K.xhr.status:null,X.statusCode=X.status):(X.rawResponse=null,X.status=null),K.callback(X)}K.emit("response",fe);var Me;try{K._isResponseOK(fe)||(Me=new Error(fe.statusText||fe.text||"Unsuccessful HTTP response"))}catch(we){Me=we}Me?(Me.original=X,Me.response=fe,Me.status=fe.status,K.callback(Me,fe)):K.callback(null,fe)})}h(A.prototype),x(A.prototype,_.prototype),A.prototype.type=function(re){return this.set("Content-Type",L.types[re]||re),this},A.prototype.accept=function(re){return this.set("Accept",L.types[re]||re),this},A.prototype.auth=function(re,ie,K){arguments.length===1&&(ie=""),r(ie)==="object"&&ie!==null&&(K=ie,ie=""),K||(K={type:typeof btoa=="function"?"basic":"auto"});var X=K.encoder?K.encoder:function(fe){if(typeof btoa=="function")return btoa(fe);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(re,ie,K,X)},A.prototype.query=function(re){return typeof re!="string"&&(re=O(re)),re&&this._query.push(re),this},A.prototype.attach=function(re,ie,K){if(ie){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(re,ie,K||ie.name)}return this},A.prototype._getFormData=function(){return this._formData||(this._formData=new f.FormData),this._formData},A.prototype.callback=function(re,ie){if(this._shouldRetry(re,ie))return this._retry();var K=this._callback;this.clearTimeout(),re&&(this._maxRetries&&(re.retries=this._retries-1),this.emit("error",re)),K(re,ie)},A.prototype.crossDomainError=function(){var re=new Error(`Request has been terminated +Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.`);re.crossDomain=!0,re.status=this.status,re.method=this.method,re.url=this.url,this.callback(re)},A.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},A.prototype.ca=A.prototype.agent,A.prototype.buffer=A.prototype.ca,A.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},A.prototype.pipe=A.prototype.write,A.prototype._isHost=function(re){return re&&r(re)==="object"&&!Array.isArray(re)&&Object.prototype.toString.call(re)!=="[object Object]"},A.prototype.end=function(re){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=re||g,this._finalizeQueryString(),this._end()},A.prototype._setUploadTimeout=function(){var re=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout(function(){re._timeoutError("Upload timeout of ",re._uploadTimeout,"ETIMEDOUT")},this._uploadTimeout))},A.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var re=this;this.xhr=L.getXHR();var ie=this.xhr,K=this._formData||this._data;this._setTimeouts(),ie.addEventListener("readystatechange",function(){var Re=ie.readyState;if(Re>=2&&re._responseTimeoutTimer&&clearTimeout(re._responseTimeoutTimer),Re===4){var ke;try{ke=ie.status}catch{ke=0}if(!ke)return re.timedout||re._aborted?void 0:re.crossDomainError();re.emit("end")}});var X=function(ke,Ie){Ie.total>0&&(Ie.percent=Ie.loaded/Ie.total*100,Ie.percent===100&&clearTimeout(re._uploadTimeoutTimer)),Ie.direction=ke,re.emit("progress",Ie)};if(this.hasListeners("progress"))try{ie.addEventListener("progress",X.bind(null,"download")),ie.upload&&ie.upload.addEventListener("progress",X.bind(null,"upload"))}catch{}ie.upload&&this._setUploadTimeout();try{this.username&&this.password?ie.open(this.method,this.url,!0,this.username,this.password):ie.open(this.method,this.url,!0)}catch(Re){return this.callback(Re)}if(this._withCredentials&&(ie.withCredentials=!0),!this._formData&&this.method!=="GET"&&this.method!=="HEAD"&&typeof K!="string"&&!this._isHost(K)){var fe=this._header["content-type"],Me=this._serializer||L.serialize[fe?fe.split(";")[0]:""];!Me&&D(fe)&&(Me=L.serialize["application/json"]),Me&&(K=Me(K))}for(var we in this.header)this.header[we]!==null&&U(this.header,we)&&ie.setRequestHeader(we,this.header[we]);this._responseType&&(ie.responseType=this._responseType),this.emit("request",this),ie.send(typeof K>"u"?null:K)},L.agent=function(){return new S};for(var q=function(){var ie=ce[$];S.prototype[ie.toLowerCase()]=function(K,X){var fe=new L.Request(ie,K);return this._setDefaults(fe),X&&fe.end(X),fe}},$=0,ce=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];${this.setSketchFromURL(window.location.search,t)}),this.setRandomSketch=this.setRandomSketch.bind(this)}clear(){this.current=null,this.code=null;let t=window.location.protocol+"//"+window.location.host+window.location.pathname;window.history.pushState({path:t},"",t),this.url=t}setSketchFromURL(t=window.location.search,r){hush(),render(o0);let n=new URLSearchParams(t);this.searchParams=n;let o=n.get("code"),a=n.get("sketch_id"),f=n.get("showCode");if(console.log("code is",o),this.foundSketch=!1,a){var h=this.getExampleById(a);h?(this.setSketch(h),r(this.code,!1)):mf.get(`${this.state.serverURL}/sketchById`).query({sketch_id:a}).end((p,v)=>{p?(console.log("err getting sketches",p),this.setSketchFromCode(o,r)):(this.sketches=JSON.parse(v.text),this.sketches.length>0?(this.setSketch(this.sketches[0]),this.foundSketch=!0,r(this.code,this.foundSketch)):this.setSketchFromCode(o,r))})}else this.setSketchFromCode(o,r);f==="false"&&(this.emitter.emit("ui: hide all"),this.emitter.emit("hide info"))}setSketchFromCode(t,r){t?(this.code=this.decodeBase64(t),this.foundSketch=!0):this.setRandomSketch(),r(this.code,this.foundSketch)}saveImage(){}setToURL(t){this.searchParams.delete("sketch_id"),this.searchParams.delete("code"),t.sketch_id?(`${t.sketch_id}`,this.searchParams.append("sketch_id",t.sketch_id)):(`${t.sketch_id}${t.code}`,this.searchParams.append("sketch_id",t.sketch_id),this.searchParams.append("code",t.code));let r=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+this.searchParams.toString();window.history.replaceState({path:r},"",r),this.url=r}encodeBase64(t){return btoa(encodeURIComponent(t))}decodeBase64(t){return decodeURIComponent(atob(t))}setSketch(t){let r=this.decodeBase64(t.code);r.indexOf(yg)<0&&(r=`${yg} +${r} +`),this.code=r,this.current=t,this.setToURL(t)}setRandomSketch(){if(this.examples.length>0){let r;for(r=Math.floor(Math.random()*this.examples.length);r===this.exampleIndex;)r=Math.floor(Math.random()*this.examples.length);this.exampleIndex=r,this.setSketch(this.examples[r])}else{var t="osc(2"+Math.floor(Math.pow(10,Math.random()*2))+")";t+=".color("+Math.random().toFixed(2)+","+Math.random().toFixed(2)+","+Math.random().toFixed(2)+")",t+=".rotate("+Math.random().toFixed(2)+")",t+=".out(o0)",this.code=t}}shareSketch(t,r,n){this.saveSketch(t,()=>{console.log("URL is",this.url,"sketch is",this.current),r.getScreenImage(o=>{mf.post(`${this.state.serverURL}/image`).attach("previewImage",o).query({url:this.url,sketch_id:this.current.sketch_id,name:n}).end((a,f)=>{a?console.log("error postingimage",a):console.log("image response",f.text)})})})}saveSketch(t,r){let n=this,o=this.encodeBase64(t),a={code:o,parent:this.current?this.current.sketch_id:null};console.log("saving in gallery",a),mf.post(`${this.state.serverURL}/sketch`).query(a).end((f,h)=>{f?(console.log("error posting sketch",f),r&&r(f)):(console.log("response",h.text),n.setSketch({sketch_id:h.text,code:o}),r&&r(null))})}saveLocally(t){let r=this.encodeBase64(t);this.searchParams.delete("sketch_id"),this.searchParams.delete("code"),this.searchParams.append("code",r);var n=this.searchParams.toString();let o=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+n;window.history.pushState({path:o},"",o),this.url=o}getExampleById(t){var r=this.examples.filter(n=>n.sketch_id===t);return r.length<=0&&(r=this.sketches.filter(n=>n.sketch_id===t)),r[0]}}let Nr;function NS(e,t){t.on("DOMContentLoaded",function(){Nr=new JS((r,n)=>{t.emit("load and eval code",r,!1),n?t.emit("ui: hide info"):t.emit("ui: show info"),t.emit("render")},e,t),e.gallery=Nr}),t.on("gallery: save to URL",function(r){Nr.saveLocally(r)}),t.on("gallery: clear",()=>{Nr.clear()}),t.on("gallery:shareSketch",function(){const n=e.editor.editor.getValue();t.emit("repl: eval",n,(o,a)=>{a?console.warn(a):OS(f=>{Nr.shareSketch(n,e.hydra.hydra,f)},()=>{})})}),t.on("gallery:showExample",()=>{const r=e.editor.editor;t.emit("clear all"),Nr.setRandomSketch(),t.emit("repl: eval",Nr.code),r.setValue(Nr.code)})}function OS(e,t){var r=prompt(` + +HYDRA SKETCH GALLERY +/////////////////////////////////////// + +🎨 Add your sketch to the gallery of hydra sketches at https://botsin.space/@hydra. + +✍️ Type your name, mastodon handle, or a short description below, and then press 'OK' to share. + +‼️ Make sure you are ready to share - there is no undo button! + +💖 Thank you for sharing! You are also warmly invited to join the the live coding server on the fediverse at https://social.toplap.org/. +`,"");r!==null?e(r):t()}var BS=FS,mg={class:"className",for:"htmlFor","http-equiv":"httpEquiv"};function FS(e){return function(t,r,n){for(var o in r)o in mg&&(r[mg[o]]=r[o],delete r[o]);return e(t,r,n)}}var DS=BS,qn=0,$i=1,si=2,$a=3,Ji=4,Mt=5,vf=6,gn=7,Bt=8,as=9,ls=10,bo=11,yn=12,es=13,jS=function(e,t){t||(t={});var r=t.concat||function(o,a){return String(o)+String(a)};return t.attrToProp!==!1&&(e=DS(e)),function(o){for(var a=$i,f="",h=arguments.length,p=[],v=0;v1&&(U.pop(),U[U.length-1][0][2][g]=e(R[0],R[1],R[2].length?R[2]:void 0))}else if(S===si){var L=[y[1],{},[]];R[2].push(L),U.push([L,R[2].length-1])}else if(S===Mt||S===qn&&y[1]===Mt){for(var G="",O;v1&&/^\s*$/.test(x[2][0])&&x[2].shift(),x[2].length>2||x[2].length===2&&/\S/.test(x[2][1])){if(t.createFragment)return t.createFragment(x[2]);throw new Error("multiple root elements must be wrapped in an enclosing tag")}return Array.isArray(x[2][0])&&typeof x[2][0][0]=="string"&&Array.isArray(x[2][0][2])&&(x[2][0]=e(x[2][0][0],x[2][0][1],x[2][0][2])),x[2][0];function F(V){var D=[];a===gn&&(a=Ji);for(var ee=0;ee"&&!PS(a)&&a!==es?(a===si&&f.length?D.push([si,f]):a===Mt?D.push([Mt,f]):a===Bt&&f.length&&D.push([Bt,f]),D.push([$a]),f="",a=$i):a===es&&/-$/.test(f)&&A==="-"?(t.comments&&D.push([Bt,f.substr(0,f.length-1)]),f="",a=$i):a===si&&/^!--$/.test(f)?(t.comments&&D.push([si,f],[Mt,"comment"],[bo]),f=A,a=es):a===$i||a===es?f+=A:a===si&&A==="/"&&f.length||(a===si&&/\s/.test(A)?(f.length&&D.push([si,f]),f="",a=Ji):a===si?f+=A:a===Ji&&/[^\s"'=/]/.test(A)?(a=Mt,f=A):a===Ji&&/\s/.test(A)?(f.length&&D.push([Mt,f]),D.push([yn])):a===Mt&&/\s/.test(A)?(D.push([Mt,f]),f="",a=vf):a===Mt&&A==="="?(D.push([Mt,f],[bo]),f="",a=gn):a===Mt?f+=A:(a===vf||a===Ji)&&A==="="?(D.push([bo]),a=gn):(a===vf||a===Ji)&&!/\s/.test(A)?(D.push([yn]),/[\w-]/.test(A)?(f+=A,a=Mt):a=Ji):a===gn&&A==='"'?a=ls:a===gn&&A==="'"?a=as:a===ls&&A==='"'?(D.push([Bt,f],[yn]),f="",a=Ji):a===as&&A==="'"?(D.push([Bt,f],[yn]),f="",a=Ji):a===gn&&!/\s/.test(A)?(a=Bt,ee--):a===Bt&&/\s/.test(A)?(D.push([Bt,f],[yn]),f="",a=Ji):(a===Bt||a===as||a===ls)&&(f+=A))}return a===$i&&f.length?(D.push([$i,f]),f=""):a===Bt&&f.length?(D.push([Bt,f]),f=""):a===ls&&f.length?(D.push([Bt,f]),f=""):a===as&&f.length?(D.push([Bt,f]),f=""):a===Mt&&(D.push([Mt,f]),f=""),D}};function n(o){return typeof o=="function"||typeof o=="string"||o&&typeof o=="object"||o==null?o:r("",o)}};function PS(e){return e===as||e===ls}var GS=RegExp("^("+["area","base","basefont","bgsound","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr","!--","animate","animateTransform","circle","cursor","desc","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","font-face-format","font-face-name","font-face-uri","glyph","glyphRef","hkern","image","line","missing-glyph","mpath","path","polygon","polyline","rect","set","stop","tref","use","view","vkern"].join("|")+")(?:[.#][a-zA-Z0-9-￿_:-]+)*$");function WS(e){return GS.test(e)}var Xa=/\n[\s]+$/,qa=/^\n[\s]+/,vg=/[\s]+$/,_g=/^[\s]+/,el=/[\n\s]+/g,wg=["a","abbr","b","bdi","bdo","br","cite","data","dfn","em","i","kbd","mark","q","rp","rt","rtc","ruby","s","amp","small","span","strong","sub","sup","time","u","var","wbr"],tl=["code","pre","textarea"],KS=function e(t,r){if(Array.isArray(r))for(var n=t.nodeName.toLowerCase(),o=!1,a,f,h=0,p=r.length;hv=>t(p,v),a=(p,v,_,y)=>At` + `,f=e.showInfo?a("close","fa-times",n("toolbar.hide-info"),"ui: toggle info"):a("close","fa-question-circle",n("toolbar.show-info"),"ui: toggle info"),h=e.showExtensions?a("close","fa-question-circle",n("toolbar.show-info"),"ui: hide extensions"):a("add","fa-solid fa-puzzle-piece",n("toolbar.load-extension"),"ui: show extensions");return At`
+ ${a("run",`fa-play-circle ${r}`,n("toolbar.run"),"editor: eval all")} + ${a("clear",`fa fa-trash ${r}`,n("toolbar.clear"),"clear all")} + ${h} + ${a("shuffle","fa-random",n("toolbar.shuffle"),"gallery:showExample")} + ${a("mutator",`fa-dice ${r}`,n("toolbar.random"),"editor: randomize")} + ${e.serverURL===null?"":a("share",`fa-upload ${r}`,n("toolbar.upload"),"gallery:shareSketch")} + ${f} +
`}const fM=({content:e,header:t},r,n)=>{r.translation;const o=r.translation.selectedLanguage==="ar"&&r.showInfo===!0?"rtl":"ltr";return At` +
+ +
+`},cM=(e,t,r)=>()=>r(e,t),bg=(e,t,r,n)=>At` +`,hM=(e,t,r,n)=>At`
+ + +
+
{r("extensions: load example",t,0)}} style="cursor:pointer">${e.name} - ${e.author}
+
${e.description}
+
+
+
+ ${bg("add-extension","fa-solid fa-plus",n("extensions.show-library",{"extension-name":e.name}),cM("extensions: add to editor",t,r))} + ${bg("show-documentation","fa-book-open",n("extensions.show-docs",{"extension-name":e.name}),()=>{window.open(e.documentation,"_blank")})} +
+
+ ${e.examples.map((o,a)=>At`
{r("extensions: load example",t,a)}}>${a+1}
`)} +
+
`,pM=(e,t)=>{const{categories:r,selectedCategoryIndex:n}=e.extensions,o=r[n].entries,{t:a}=e.translation,f=At` +`,h=At`
+ ${r.map((p,v)=>At`
t("extensions: select category",v)} + >${p.name}
`)} +
`;return{content:f,header:h}},Ni=e=>`href=${e} target=_blank`,dM=e=>At` +`;function gM(e,t){const{t:r,languages:n}=e.translation,o=Object.entries(n),a=At`
`,f=At` + ${e.showInfo&&o.length>1?At`
${o.map(([p,v])=>At` +
t("set language",p)}>${v}
+ `)}
`:At`
`} + ${dM(r)} + `,h=e.showExtensions?pM(e,t):{content:f,header:a};return fM(h,e,t)}var xg=typeof gt<"u"?gt:typeof window<"u"?window:{},yM=bs,To;typeof document<"u"?To=document:(To=xg["__GLOBAL_DOCUMENT_CACHE@4"],To||(To=xg["__GLOBAL_DOCUMENT_CACHE@4"]=yM));var Qm=To,Zl={exports:{}},Eo;typeof window<"u"?Eo=window:typeof gt<"u"?Eo=gt:typeof self<"u"?Eo=self:Eo={};var mM=Eo,_f=Qm,Sg=mM,jt=Object.create(null),Ym="onloadid"+Math.random().toString(36).slice(2),Sn="data-"+Ym,wf=0;if(Sg&&Sg.MutationObserver){var vM=new MutationObserver(function(e){if(!(Object.keys(jt).length<1))for(var t=0;t0&&Sc(e[n].childNodes,t)}}var bM=Zl.exports,xM=Zm;class Hm extends Error{}Hm.prototype.name="AssertionError";function Zm(e,t){if(!e){var r=new Hm(t);throw Error.captureStackTrace&&Error.captureStackTrace(r,Zm),r}}const $m=Qm,ko=$c,SM=ym,fh=bM,Mc=xM,MM=fh.KEY_ID,CM=fh.KEY_ATTR;var TM=li;function EM(){return"ncid-"+Math.floor((1+Math.random())*65536).toString(16).substring(1)}li.makeID=EM;function li(e){this._hasWindow=typeof window<"u",this._id=null,this._ncID=null,this._olID=null,this._proxy=null,this._loaded=!1,this._rootNodeName=null,this._name=e||"nanocomponent",this._rerender=!1,this._handleLoad=this._handleLoad.bind(this),this._handleUnload=this._handleUnload.bind(this),this._arguments=[];const t=this;Object.defineProperty(this,"element",{get:function(){const r=$m.getElementById(t._id);if(r)return r.dataset.nanocomponent===t._ncID?r:void 0}})}li.prototype.render=function(){const e=ko(this._name+".render"),t=this,r=new Array(arguments.length);let n;for(let o=0;o{o.setup=()=>{o.createCanvas(t,r,o[n])},o.draw=()=>{}},"hydra-ui"),this.width=t,this.height=r,this.mode=n,this.canvas.style.position="absolute",this.canvas.style.top="0px",this.canvas.style.left="0px",this.canvas.style.zIndex=-1}show(){this.canvas.style.visibility="visible"}hide(){this.canvas.style.visibility="hidden"}clear(){this.drawingContext.clearRect(0,0,this.canvas.width,this.canvas.height)}}var Cc={exports:{}},RM=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,LM=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],qm=function(t){var r=t,n=t.indexOf("["),o=t.indexOf("]");n!=-1&&o!=-1&&(t=t.substring(0,n)+t.substring(n,o).replace(/:/g,";")+t.substring(o,t.length));for(var a=RM.exec(t||""),f={},h=14;h--;)f[LM[h]]=a[h]||"";return n!=-1&&o!=-1&&(f.source=r,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=UM(f,f.path),f.queryKey=IM(f,f.query),f};function UM(e,t){var r=/\/{2,9}/g,n=t.replace(r,"/").split("/");return(t.substr(0,1)=="/"||t.length===0)&&n.splice(0,1),t.substr(t.length-1,1)=="/"&&n.splice(n.length-1,1),n}function IM(e,t){var r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,o,a){o&&(r[o]=a)}),r}var Tc={exports:{}},Ec={exports:{}},Do=1e3,jo=Do*60,Po=jo*60,Go=Po*24,JM=Go*365.25,NM=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return OM(e);if(r==="number"&&isNaN(e)===!1)return t.long?FM(e):BM(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function OM(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*JM;case"days":case"day":case"d":return r*Go;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Po;case"minutes":case"minute":case"mins":case"min":case"m":return r*jo;case"seconds":case"second":case"secs":case"sec":case"s":return r*Do;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function BM(e){return e>=Go?Math.round(e/Go)+"d":e>=Po?Math.round(e/Po)+"h":e>=jo?Math.round(e/jo)+"m":e>=Do?Math.round(e/Do)+"s":e+"ms"}function FM(e){return il(e,Go,"day")||il(e,Po,"hour")||il(e,jo,"minute")||il(e,Do,"second")||e+" ms"}function il(e,t,r){if(!(e=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}t.formatters.j=function(p){try{return JSON.stringify(p)}catch(v){return"[UnexpectedJSONParseError]: "+v.message}};function n(p){var v=this.useColors;if(p[0]=(v?"%c":"")+this.namespace+(v?" %c":" ")+p[0]+(v?"%c ":" ")+"+"+t.humanize(this.diff),!!v){var _="color: "+this.color;p.splice(1,0,_,"color: inherit");var y=0,m=0;p[0].replace(/%[a-zA-Z%]/g,function(x){x!=="%%"&&(y++,x==="%c"&&(m=y))}),p.splice(m,0,_)}}function o(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(p){try{p==null?t.storage.removeItem("debug"):t.storage.debug=p}catch{}}function f(){var p;try{p=t.storage.debug}catch{}return!p&&typeof process<"u"&&"env"in process&&(p={}.DEBUG),p}t.enable(f());function h(){try{return window.localStorage}catch{}}})(Tc,Tc.exports);var $l=Tc.exports,jM=qm,Tg=$l("socket.io-client:url"),PM=GM;function GM(e,t){var r=e;t=t||typeof location<"u"&&location,e==null&&(e=t.protocol+"//"+t.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=t.protocol+e:e=t.host+e),/^(https?|wss?):\/\//.test(e)||(Tg("protocol-less url %s",e),typeof t<"u"?e=t.protocol+"//"+e:e="https://"+e),Tg("parse %s",e),r=jM(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var n=r.host.indexOf(":")!==-1,o=n?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port,r.href=r.protocol+"://"+o+(t&&t.port===r.port?"":":"+r.port),r}var Xl={},kc={exports:{}},Ac={exports:{}},Wo=1e3,Ko=Wo*60,Vo=Ko*60,zo=Vo*24,WM=zo*365.25,KM=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return VM(e);if(r==="number"&&isNaN(e)===!1)return t.long?QM(e):zM(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function VM(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*WM;case"days":case"day":case"d":return r*zo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Vo;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ko;case"seconds":case"second":case"secs":case"sec":case"s":return r*Wo;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function zM(e){return e>=zo?Math.round(e/zo)+"d":e>=Vo?Math.round(e/Vo)+"h":e>=Ko?Math.round(e/Ko)+"m":e>=Wo?Math.round(e/Wo)+"s":e+"ms"}function QM(e){return rl(e,zo,"day")||rl(e,Vo,"hour")||rl(e,Ko,"minute")||rl(e,Wo,"second")||e+" ms"}function rl(e,t,r){if(!(e=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}t.formatters.j=function(p){try{return JSON.stringify(p)}catch(v){return"[UnexpectedJSONParseError]: "+v.message}};function n(p){var v=this.useColors;if(p[0]=(v?"%c":"")+this.namespace+(v?" %c":" ")+p[0]+(v?"%c ":" ")+"+"+t.humanize(this.diff),!!v){var _="color: "+this.color;p.splice(1,0,_,"color: inherit");var y=0,m=0;p[0].replace(/%[a-zA-Z%]/g,function(x){x!=="%%"&&(y++,x==="%c"&&(m=y))}),p.splice(m,0,_)}}function o(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(p){try{p==null?t.storage.removeItem("debug"):t.storage.debug=p}catch{}}function f(){var p;try{p=t.storage.debug}catch{}return!p&&typeof process<"u"&&"env"in process&&(p={}.DEBUG),p}t.enable(f());function h(){try{return window.localStorage}catch{}}})(kc,kc.exports);var HM=kc.exports,ql={},ZM={}.toString,e0=Array.isArray||function(e){return ZM.call(e)=="[object Array]"},t0=eC,$M=typeof Buffer=="function"&&typeof Buffer.isBuffer=="function",XM=typeof ArrayBuffer=="function",qM=function(e){return typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer};function eC(e){return $M&&Buffer.isBuffer(e)||XM&&(e instanceof ArrayBuffer||qM(e))}var ch=e0,i0=t0,r0=Object.prototype.toString,tC=typeof Blob=="function"||typeof Blob<"u"&&r0.call(Blob)==="[object BlobConstructor]",iC=typeof File=="function"||typeof File<"u"&&r0.call(File)==="[object FileConstructor]";ql.deconstructPacket=function(e){var t=[],r=e.data,n=e;return n.data=Rc(r,t),n.attachments=t.length,{packet:n,buffers:t}};function Rc(e,t){if(!e)return e;if(i0(e)){var r={_placeholder:!0,num:t.length};return t.push(e),r}else if(ch(e)){for(var n=new Array(e.length),o=0;o=0&&e.numn&&(r=n),t>=n||t>=r||n===0)return new ArrayBuffer(0);for(var o=new Uint8Array(e),a=new Uint8Array(r-t),f=t,h=0;f=55296&&o<=56319&&r65535&&(n-=65536,o+=Dr(n>>>10&1023|55296),n=56320|n&1023),o+=Dr(n);return o}function l0(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function bf(e,t){return Dr(e>>t&63|128)}function mC(e,t){if(!(e&4294967168))return Dr(e);var r="";return e&4294965248?e&4294901760?e&4292870144||(r=Dr(e>>18&7|240),r+=bf(e,12),r+=bf(e,6)):(l0(e,t)||(e=65533),r=Dr(e>>12&15|224),r+=bf(e,6)):r=Dr(e>>6&31|192),r+=Dr(e&63|128),r}function vC(e,t){t=t||{};for(var r=t.strict!==!1,n=a0(e),o=n.length,a=-1,f,h="";++a=Nl)throw Error("Invalid byte index");var e=Jl[Pr]&255;if(Pr++,(e&192)==128)return e&63;throw Error("Invalid continuation byte")}function _C(e){var t,r,n,o,a;if(Pr>Nl)throw Error("Invalid byte index");if(Pr==Nl)return!1;if(t=Jl[Pr]&255,Pr++,!(t&128))return t;if((t&224)==192){if(r=ts(),a=(t&31)<<6|r,a>=128)return a;throw Error("Invalid continuation byte")}if((t&240)==224){if(r=ts(),n=ts(),a=(t&15)<<12|r<<6|n,a>=2048)return l0(a,e)?a:65533;throw Error("Invalid continuation byte")}if((t&248)==240&&(r=ts(),n=ts(),o=ts(),a=(t&7)<<18|r<<12|n<<6|o,a>=65536&&a<=1114111))return a;throw Error("Invalid UTF-8 detected")}var Jl,Nl,Pr;function wC(e,t){t=t||{};var r=t.strict!==!1;Jl=a0(e),Nl=Jl.length,Pr=0;for(var n=[],o;(o=_C(r))!==!1;)n.push(o);return yC(n)}var bC={version:"2.1.2",encode:vC,decode:wC},nl={},Eg;function xC(){return Eg||(Eg=1,function(e){nl.encode=function(t){var r=new Uint8Array(t),n,o=r.length,a="";for(n=0;n>2],a+=e[(r[n]&3)<<4|r[n+1]>>4],a+=e[(r[n+1]&15)<<2|r[n+2]>>6],a+=e[r[n+2]&63];return o%3===2?a=a.substring(0,a.length-1)+"=":o%3===1&&(a=a.substring(0,a.length-2)+"=="),a},nl.decode=function(t){var r=t.length*.75,n=t.length,o,a=0,f,h,p,v;t[t.length-1]==="="&&(r--,t[t.length-2]==="="&&r--);var _=new ArrayBuffer(r),y=new Uint8Array(_);for(o=0;o>4,y[a++]=(h&15)<<4|p>>2,y[a++]=(p&3)<<6|v&63;return _}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")),nl}var xf,kg;function SC(){if(kg)return xf;kg=1;var e=typeof e<"u"?e:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:!1,t=function(){try{var h=new Blob(["hi"]);return h.size===2}catch{return!1}}(),r=t&&function(){try{var h=new Blob([new Uint8Array([1,2])]);return h.size===2}catch{return!1}}(),n=e&&e.prototype.append&&e.prototype.getBlob;function o(h){return h.map(function(p){if(p.buffer instanceof ArrayBuffer){var v=p.buffer;if(p.byteLength!==v.byteLength){var _=new Uint8Array(p.byteLength);_.set(new Uint8Array(v,p.byteOffset,p.byteLength)),v=_.buffer}return v}return p})}function a(h,p){p=p||{};var v=new e;return o(h).forEach(function(_){v.append(_)}),p.type?v.getBlob(p.type):v.getBlob()}function f(h,p){return new Blob(o(h),p||{})}return typeof Blob<"u"&&(a.prototype=Blob.prototype,f.prototype=Blob.prototype),xf=function(){return t?r?Blob:f:n?a:void 0}(),xf}(function(e){var t=oC,r=s0,n=hC,o=pC,a=bC,f;typeof ArrayBuffer<"u"&&(f=xC());var h=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),p=typeof navigator<"u"&&/PhantomJS/i.test(navigator.userAgent),v=h||p;e.protocol=3;var _=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},y=t(_),m={type:"error",data:"parser error"},x=SC();e.encodePacket=function(O,P,F,V){typeof P=="function"&&(V=P,P=!1),typeof F=="function"&&(V=F,F=null);var D=O.data===void 0?void 0:O.data.buffer||O.data;if(typeof ArrayBuffer<"u"&&D instanceof ArrayBuffer)return R(O,P,V);if(typeof x<"u"&&D instanceof x)return g(O,P,V);if(D&&D.base64)return U(O,V);var ee=_[O.type];return O.data!==void 0&&(ee+=F?a.encode(String(O.data),{strict:!1}):String(O.data)),V(""+ee)};function U(O,P){var F="b"+e.packets[O.type]+O.data.data;return P(F)}function R(O,P,F){if(!P)return e.encodeBase64Packet(O,F);var V=O.data,D=new Uint8Array(V),ee=new Uint8Array(1+V.byteLength);ee[0]=_[O.type];for(var A=0;A1?{type:y[D],data:O.substring(1)}:{type:y[D]}}var V=new Uint8Array(O),D=V[0],ee=n(O,1);return x&&P==="blob"&&(ee=new x([ee])),{type:y[D],data:ee}};function L(O){try{O=a.decode(O,{strict:!1})}catch{return!1}return O}e.decodeBase64Packet=function(O,P){var F=y[O.charAt(0)];if(!f)return{type:F,data:{base64:!0,data:O.substr(1)}};var V=f.decode(O.substr(1));return P==="blob"&&x&&(V=new x([V])),{type:F,data:V}},e.encodePayload=function(O,P,F){typeof P=="function"&&(F=P,P=null);var V=r(O);if(P&&V)return x&&!v?e.encodePayloadAsBlob(O,F):e.encodePayloadAsArrayBuffer(O,F);if(!O.length)return F("0:");function D(A){return A.length+":"+A}function ee(A,q){e.encodePacket(A,V?P:!1,!1,function($){q(null,D($))})}G(O,ee,function(A,q){return F(q.join(""))})};function G(O,P,F){for(var V=new Array(O.length),D=o(O.length,F),ee=function(q,$,ce){P($,function(ye,re){V[q]=re,ce(ye,V)})},A=0;A0;){for(var ee=new Uint8Array(V),A=ee[0]===0,q="",$=1;ee[$]!==255;$++){if(q.length>310)return F(m,0,1);q+=ee[$]}V=n(V,2+q.length),q=parseInt(q);var ce=n(V,0,q);if(A)try{ce=String.fromCharCode.apply(null,new Uint8Array(ce))}catch{var ye=new Uint8Array(ce);ce="";for(var $=0;$0);return t}function MC(e){var t=0;for(Gr=0;Gr0)return EC(e);if(r==="number"&&isNaN(e)===!1)return t.long?AC(e):kC(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function EC(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*CC;case"days":case"day":case"d":return r*Zo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ho;case"minutes":case"minute":case"mins":case"min":case"m":return r*Yo;case"seconds":case"second":case"secs":case"sec":case"s":return r*Qo;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function kC(e){return e>=Zo?Math.round(e/Zo)+"d":e>=Ho?Math.round(e/Ho)+"h":e>=Yo?Math.round(e/Yo)+"m":e>=Qo?Math.round(e/Qo)+"s":e+"ms"}function AC(e){return sl(e,Zo,"day")||sl(e,Ho,"hour")||sl(e,Yo,"minute")||sl(e,Qo,"second")||e+" ms"}function sl(e,t,r){if(!(e=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}t.formatters.j=function(p){try{return JSON.stringify(p)}catch(v){return"[UnexpectedJSONParseError]: "+v.message}};function n(p){var v=this.useColors;if(p[0]=(v?"%c":"")+this.namespace+(v?" %c":" ")+p[0]+(v?"%c ":" ")+"+"+t.humanize(this.diff),!!v){var _="color: "+this.color;p.splice(1,0,_,"color: inherit");var y=0,m=0;p[0].replace(/%[a-zA-Z%]/g,function(x){x!=="%%"&&(y++,x==="%c"&&(m=y))}),p.splice(m,0,_)}}function o(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(p){try{p==null?t.storage.removeItem("debug"):t.storage.debug=p}catch{}}function f(){var p;try{p=t.storage.debug}catch{}return!p&&typeof process<"u"&&"env"in process&&(p={}.DEBUG),p}t.enable(f());function h(){try{return window.localStorage}catch{}}})(Jc,Jc.exports);var iu=Jc.exports,h0=yh(),LC=Ss,p0=Tn,UC=tu,IC=c0,Fi=iu("engine.io-client:polling"),d0=sr,JC=function(){var e=dh,t=new e({xdomain:!1});return t.responseType!=null}();function sr(e){var t=e&&e.forceBase64;(!JC||t)&&(this.supportsBinary=!1),h0.call(this,e)}UC(sr,h0);sr.prototype.name="polling";sr.prototype.doOpen=function(){this.poll()};sr.prototype.pause=function(e){var t=this;this.readyState="pausing";function r(){Fi("paused"),t.readyState="paused",e()}if(this.polling||!this.writable){var n=0;this.polling&&(Fi("we are currently polling - waiting to pause"),n++,this.once("pollComplete",function(){Fi("pre-pause polling complete"),--n||r()})),this.writable||(Fi("we are currently writing - waiting to pause"),n++,this.once("drain",function(){Fi("pre-pause writing complete"),--n||r()}))}else r()};sr.prototype.poll=function(){Fi("polling"),this.polling=!0,this.doPoll(),this.emit("poll")};sr.prototype.onData=function(e){var t=this;Fi("polling got data %s",e);var r=function(n,o,a){if(t.readyState==="opening"&&n.type==="open"&&t.onOpen(),n.type==="close")return t.onClose(),!1;t.onPacket(n)};p0.decodePayload(e,this.socket.binaryType,r),this.readyState!=="closed"&&(this.polling=!1,this.emit("pollComplete"),this.readyState==="open"?this.poll():Fi('ignoring poll - transport state "%s"',this.readyState))};sr.prototype.doClose=function(){var e=this;function t(){Fi("writing close packet"),e.write([{type:"close"}])}this.readyState==="open"?(Fi("transport open - closing"),t()):(Fi("transport not open - deferring close"),this.once("open",t))};sr.prototype.write=function(e){var t=this;this.writable=!1;var r=function(){t.writable=!0,t.emit("drain")};p0.encodePayload(e,this.supportsBinary,function(n){t.doWrite(n,r)})};sr.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",r="";this.timestampRequests!==!1&&(e[this.timestampParam]=IC()),!this.supportsBinary&&!e.sid&&(e.b64=1),e=LC.encode(e),this.port&&(t==="https"&&Number(this.port)!==443||t==="http"&&Number(this.port)!==80)&&(r=":"+this.port),e.length&&(e="?"+e);var n=this.hostname.indexOf(":")!==-1;return t+"://"+(n?"["+this.hostname+"]":this.hostname)+r+this.path+e};var NC=dh,g0=d0,OC=Cn,BC=tu,Oc=iu("engine.io-client:polling-xhr"),FC=ph;gh.exports=Ms;gh.exports.Request=Jt;function Ug(){}function Ms(e){if(g0.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,typeof location<"u"){var t=location.protocol==="https:",r=location.port;r||(r=t?443:80),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port,this.xs=e.secure!==t}}BC(Ms,g0);Ms.prototype.supportsBinary=!0;Ms.prototype.request=function(e){return e=e||{},e.uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.withCredentials=this.withCredentials,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new Jt(e)};Ms.prototype.doWrite=function(e,t){var r=typeof e!="string"&&e!==void 0,n=this.request({method:"POST",data:e,isBinary:r}),o=this;n.on("success",t),n.on("error",function(a){o.onError("xhr post error",a)}),this.sendXhr=n};Ms.prototype.doPoll=function(){Oc("xhr poll");var e=this.request(),t=this;e.on("data",function(r){t.onData(r)}),e.on("error",function(r){t.onError("xhr poll error",r)}),this.pollXhr=e};function Jt(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=e.async!==!1,this.data=e.data!==void 0?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.withCredentials=e.withCredentials,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}OC(Jt.prototype);Jt.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new NC(e),r=this;try{Oc("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(var n in this.extraHeaders)this.extraHeaders.hasOwnProperty(n)&&t.setRequestHeader(n,this.extraHeaders[n])}}catch{}if(this.method==="POST")try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{t.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in t&&(t.withCredentials=this.withCredentials),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){r.onLoad()},t.onerror=function(){r.onError(t.responseText)}):t.onreadystatechange=function(){if(t.readyState===2)try{var o=t.getResponseHeader("Content-Type");(r.supportsBinary&&o==="application/octet-stream"||o==="application/octet-stream; charset=UTF-8")&&(t.responseType="arraybuffer")}catch{}t.readyState===4&&(t.status===200||t.status===1223?r.onLoad():setTimeout(function(){r.onError(typeof t.status=="number"?t.status:0)},0))},Oc("xhr data %s",this.data),t.send(this.data)}catch(o){setTimeout(function(){r.onError(o)},0);return}typeof document<"u"&&(this.index=Jt.requestsCount++,Jt.requests[this.index]=this)};Jt.prototype.onSuccess=function(){this.emit("success"),this.cleanup()};Jt.prototype.onData=function(e){this.emit("data",e),this.onSuccess()};Jt.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)};Jt.prototype.cleanup=function(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=Ug:this.xhr.onreadystatechange=Ug,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Jt.requests[this.index],this.xhr=null}};Jt.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch{}t==="application/octet-stream"||t==="application/octet-stream; charset=UTF-8"?e=this.xhr.response||this.xhr.responseText:e=this.xhr.responseText}catch(r){this.onError(r)}e!=null&&this.onData(e)};Jt.prototype.hasXDR=function(){return typeof XDomainRequest<"u"&&!this.xs&&this.enablesXDR};Jt.prototype.abort=function(){this.cleanup()};Jt.requestsCount=0;Jt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Ig);else if(typeof addEventListener=="function"){var DC="onpagehide"in FC?"pagehide":"unload";addEventListener(DC,Ig,!1)}}function Ig(){for(var e in Jt.requests)Jt.requests.hasOwnProperty(e)&&Jt.requests[e].abort()}var jC=gh.exports,vh=d0,PC=tu,Jg=ph,GC=Cs,WC=/\n/g,KC=/\\n/g,ol;function VC(){}function Cs(e){vh.call(this,e),this.query=this.query||{},ol||(ol=Jg.___eio=Jg.___eio||[]),this.index=ol.length;var t=this;ol.push(function(r){t.onData(r)}),this.query.j=this.index,typeof addEventListener=="function"&&addEventListener("beforeunload",function(){t.script&&(t.script.onerror=VC)},!1)}PC(Cs,vh);Cs.prototype.supportsBinary=!1;Cs.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),vh.prototype.doClose.call(this)};Cs.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(o){e.onError("jsonp poll error",o)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(t,r):(document.head||document.body).appendChild(t),this.script=t;var n=typeof navigator<"u"&&/gecko/i.test(navigator.userAgent);n&&setTimeout(function(){var o=document.createElement("iframe");document.body.appendChild(o),document.body.removeChild(o)},100)};Cs.prototype.doWrite=function(e,t){var r=this;if(!this.form){var n=document.createElement("form"),o=document.createElement("textarea"),a=this.iframeId="eio_iframe_"+this.index,f;n.className="socketio",n.style.position="absolute",n.style.top="-1000px",n.style.left="-1000px",n.target=a,n.method="POST",n.setAttribute("accept-charset","utf-8"),o.name="d",n.appendChild(o),document.body.appendChild(n),this.form=n,this.area=o}this.form.action=this.uri();function h(){p(),t()}function p(){if(r.iframe)try{r.form.removeChild(r.iframe)}catch(_){r.onError("jsonp polling iframe removal error",_)}try{var v='